Skip to main content
Contributor I
May 9, 2023
Solved

Abandoned Cart Snippet Google Tag Manager

  • May 9, 2023
  • 3 replies
  • 716 views

Hello,

Does anyone have a code snippet to check for an Abandoned Cart that I can install through Google Tag Manager?

 

Thank you!

    This topic has been closed for replies.
    Best answer by David To

    Hey @bjones,

    In that case, I would suggest taking a look through our Integrate an ecommerce platform without a pre-built Klaviyo integration Developer guide. In it, you’ll find resources and guidance on how to connect a custom ecommerce platform to Klaviyo when there isn’t a native integration available.

    This method would be more effective since many of those ecommerce events you’ll want to record and trigger are done in the backend on server side such as purchased/placed order events. 

    However, I would imagine you would most likely be able to use Google Tag Manager to help install the codes that are fired on the front-end via javascript. 

    If you need more hands on assistance, I would further recommend reaching out to one of our many skilled developers through our Klaviyo Partner Directory.

    David

    3 replies

    David To
    Klaviyo Employee
    Klaviyo Employee
    May 10, 2023

    Hello @bjones,

    Welcome to the Klaviyo Community!

    When you mean “abandoned cart code” are you talking about the add to cart code used for Shopify and BigCommerce?

    If so, then I would suggest using the installation method provided in either our How to create an "Added to Cart" event for Shopify or How to create an "Added to Cart" event for BigCommerce Help Center articles depending on your ecommerce backend. 

    Because you will need to both formulate and place the code in the correct spot, Google Tag Manager may not be the most effective installation method. 

    I hope this helps!

    David

    bjonesAuthor
    Contributor I
    May 10, 2023

    Hi @David To ,

    Thanks for the response.
    I am looking to add a tag to Google Tag Manager that will indentify an abandoned cart and pass that information to Klaviyo.
    I am using a custom site (https://www.ceylonsurfsummit.com/) that doesn’t support a direct integration with Klaviyo, hence why I am going through Google Tag Manager. The data layer on this site already has “add to cart”, “remove from cart”, “purchase” etc events, so they events are there. I just need a way to get Klaviyo to recognise the abandoned cart.

    Any ideas?
    Thanks!

    David To
    Klaviyo Employee
    David ToAnswer
    Klaviyo Employee
    May 10, 2023

    Hey @bjones,

    In that case, I would suggest taking a look through our Integrate an ecommerce platform without a pre-built Klaviyo integration Developer guide. In it, you’ll find resources and guidance on how to connect a custom ecommerce platform to Klaviyo when there isn’t a native integration available.

    This method would be more effective since many of those ecommerce events you’ll want to record and trigger are done in the backend on server side such as purchased/placed order events. 

    However, I would imagine you would most likely be able to use Google Tag Manager to help install the codes that are fired on the front-end via javascript. 

    If you need more hands on assistance, I would further recommend reaching out to one of our many skilled developers through our Klaviyo Partner Directory.

    David