Skip to main content
All CollectionsBest practices & Use casesE-commerce specific use cases
Add a product to the cart when a CTA is clicked (Shopify)
Add a product to the cart when a CTA is clicked (Shopify)
Updated over 2 months ago

On Shopify, we can add an item in the cart by redirecting the user to a given URL.

Prepare the URL

Let's first prepare the URL to add the item. You must find the variant ID to add to the cart. Follow the Shopify documentation to find a variant ID.

Assuming that the variant ID is 42, the URL should be:

/cart/add?id=42

Or if you want to add more than one of this product to the cart:

/cart/add?id=42&quantity=1

Configure the CTA

You can then create the button in your campaign. Choose the action "Load new page", and use the URL you prepared previously:

When a visitor clicks the CTA, the product is added to their cart and they're redirected to the cart page.

Don't hesitate to contact our support if you have any questions.

Did this answer your question?