> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://support.govalo.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Adding custom events after the Gift Card is added to the cart

Congratulations on getting started with Govalo. Now it may be time to add some custom events to your **add to cart script** in order to make sure Govalo flows through your site and feels like it belongs! This can be great for things like triggering a slide-out cart rather than directing to the cart page, for instance.

Let's dig in.

1. Open the **Online Store > Themes** section of your Shopify Admin:
![](https://storage.crisp.chat/users/helpdesk/website/-/7/1/2/d/712da65eafd3b400/snimok-ekrana-2026-10-05-v-000_jbek2n.png)

2. Use the drop-down on your current theme to select **Edit Code**:
![](https://storage.crisp.chat/users/helpdesk/website/-/7/1/2/d/712da65eafd3b400/snimok-ekrana-2026-10-05-v-000_opn14u.png)

3. In the *theme.liquid* file, before the *body* tag, add the following code:
```
<script>
  window.addEventListener("gvlo:cart:add", () => {
    const cartDrawer = document.querySelector("cart-drawer");

    if (cartDrawer && typeof cartDrawer.open === "function") {
      cartDrawer.open();
    }
  });
</script>

```
This code listens for the `gvlo:cart:add` event, which Govalo triggers after a gift card is successfully added to the cart. It then opens the cart drawer instead of sending the customer to the cart page.

3. In the Govalo app, go to **Configure > Advanced gift card configurations** and add "*#*" to the **Custom Redirect** field:
![](https://storage.crisp.chat/users/helpdesk/website/-/7/1/2/d/712da65eafd3b400/snimok-ekrana-2026-10-05-v-001_p9kr9l.png)

5. **Save** the file when you're done editing.