I've enabled and integrated and enabled my Klaviyo with my Shopify account but the code dosent appear.

  • 12 February 2023
  • 2 replies

Badge +1

Hey there everyone! 

I've recently enabled my Klaviyo account and integrated it with Shopify but the code doesnt appear when I want put to it in my code theme. Thank you






Best answer by Irrra 12 February 2023, 12:08

View original

2 replies

Userlevel 5
Badge +15

Hi @LegacyOG!

If you're having trouble integrating Klaviyo with Shopify, here are a few things you can try to resolve the issue:

  1. Check the integration setup: Make sure that you've completed all the steps for integrating Klaviyo with Shopify. This typically involves adding the Klaviyo tracking code to your Shopify theme, setting up Shopify event tracking, and connecting your Klaviyo account to your Shopify store.

  2. Check the theme code: Make sure that the Klaviyo tracking code is properly installed in the correct location in your Shopify theme code. The code should be added immediately after the opening <head> tag.

  3. Check the code format: Make sure that the Klaviyo tracking code is formatted correctly and that there are no typos or syntax errors.

  4. Disable any ad-blocking software: Ad-blocking software can sometimes prevent the Klaviyo tracking code from loading. Try disabling any ad-blockers you have installed and then refresh the page to see if the code appears.

  5. Check the Shopify domain: Make sure that the Klaviyo tracking code is installed on the correct domain. If you have a custom domain set up in Shopify, you will need to make sure that the Klaviyo tracking code is installed on that domain, not the default Shopify domain.

Or you can manually add the snippet to your theme.liquid file. With the {% if %} logic we provide, we'll ensure this only appears on the product pages.

{% if product %}

<script type="text/javascript"> var _learnq = _learnq || []; var item = {

   Name: {{ product.title|json }},

   ProductID: {{|json }},

   Categories: {{ product.collections|map:'title'|json }},

   ImageURL: "https:{{ product.featured_image.src|img_url:'grande' }}",

   URL: "{{ shop.secure_url }}{{ product.url }}",

   Brand: {{ product.vendor|json }},

   Price: {{ product.price|money|json }},

   CompareAtPrice: {{ product.compare_at_price_max|money|json }} };

 _learnq.push(['track', 'Viewed Product', item]);

 _learnq.push(['trackViewedItem', {

   Title: item.Name,

   ItemId: item.ProductID,

   Categories: item.Categories,

   ImageUrl: item.ImageURL,

   Url: item.URL,

   Metadata: {

     Brand: item.Brand,

     Price: item.Price,

     CompareAtPrice: item.CompareAtPrice

   } }]); 


<script type="text/javascript">

var _learnq = _learnq || [];

document.getElementById("AddToCart").addEventListener('click',function (){

 _learnq.push(['track', 'Added to Cart', item]);



{% endif %}

Userlevel 4
Badge +10

Hey @LegacyOG at first I replied citing the Shopify 2.0 theme app embed process but upon looking closer at your comment I see that’s not the issue, since you’re already showing those toggle switch settings in your screenshot.


What code are you missing? I can see the Klaviyo script it on your site, as shown below. You should be good to go. Are you trying to embed a form?