Solved

I cannot get the web tracking to work with shopify

  • 4 January 2021
  • 10 replies
  • 390 views

Badge

I managed to integrate my shopify account with Klaviyo but even after pasting the snippet code into product.liquid in the shopify theme, the web tracking won’t successfully get set up - it just says ‘waiting for data’ at the bottom and won’t receive anything. 

What should I do?

icon

Best answer by quagrowth 4 January 2021, 19:24

View original

10 replies

You can check the active on site metric or viewed product metric to see if anyone qualifies. It might take some time to render the changes

Userlevel 6
Badge +5

Apologies for the delay in responding - just to chime in and agree with @quagrowth on this. There can be a little bit of a delay for when the data is synced and for the changes to apply. You can also run a test for a Checkout Started event to see if the data comes in. 
More details on how to test web tracking here

I’ve waited for 1 hour but the button never turns green. I am not sure how long the delay will last.

Userlevel 4
Badge +4

Hey @manyquests ,

Thank you for asking about the delay in your Shopify Web Tracking. 

Your Shopify Web Tracking should happen in real time, however sometimes there can be a slight delay, but usually does not take a hour to complete. I would suggest manually testing your site by cookieing your own browser and attempt to trigger the active onsite and viewed product metrics, like @cassy.lee  suggested previously. The Guide to Klaviyo Web Tracking will go in depth on how Klaviyo web tracking works and how to test your site. Often times the web tracking is already enabled through automatically being injected as part of your Shopify integration , you can test that tracking is set up properly by following these steps:

  1. Navigate to your website
  2. Add the following to the end of your store url, replacing example@gmail.com with your email address:
    ?utm_email=example@gmail.com
  3. After you reload the page, search in Klaviyo for your email address

You should see that a Klaviyo profile has been created for you (if one didn't exist already) and that this site visit has been tracked on your activity feed. Manually testing your account in this manner tends to be a more reliable and immediate way to verify that it was set up correctly, rather than waiting for the integrated tool to inform you.

If this does not solve your challenge, please refer to the Help Center article How to Install Klaviyo.JS to your Shopify Store. By adding the relevant code snippets to your site manually you can accomplish the same outcome, if the automatic installation of the code wasn’t successful.

 

Thank you for being a new member of the Klaviyo Community!!!

Hello,

How can I do the code for Web Tracking on the Dawn Theme? There is no product.liquid in template section. Thank you!

Userlevel 4
Badge +4

Hey there @Bellabeauties 

I understand you are having some difficulty with some of Klaviyo’s code snippets, since migrating to Shopify 2.0.

Shopify 2.0 was introduced to allow developers more freedom to edit code in JSON instead of Liquid template theme files within Shopify. The main difference you'll face after upgrading to Shopify 2.0 is that most of the features now rely on JSON templates. Shopify has created this guide, which provides step by step instructions for converting a Liquid template into a JSON template, and moving any required Liquid code into sections that you can include in the new JSON template. 

That said, Klaviyo's Viewed Product snippet and Added to Cart snippets were designed to be installed within Shopify's product.liquid theme files. If you navigate to your Shopify admin > Online Store > Edit Code, you should now see a product.json template instead. 

Click on the product.json template and refer to the name you see listed within sections > main > type:

?name=Img+1.png

*Please note that the names within your “sections” may vary.

In this example, the name is product-template. Then locate that title within the Sections folder: 

?name=Img+2.png

In this example, it is the product-template.liquid section file that we would open up, and search for the characters
'{ schema %}'

?name=Img+3.png

Then, you can proceed to insert the Viewed Product snippet and Add to Cart snippet (if desired) directly above the '{ schema %}' line and click Save. 
 

Hope this helped!

Alex

Badge

I’m having trouble with this as well.

I have the Out of the Sandbox Flex theme - updated to Shopify 2.0. I tried pasting my code into the product_main.liquid above the schema line, but I get an error message. I also tried the product-sections__main.liquid and get the error message. These are all the product sections I have in my theme. Which would I use?

 

Userlevel 4
Badge +4

Hi there @Leslie Nicole,

Would you mind sharing a screenshot of the error message you get after following the instructions above?

 

Thank you!

Alex

Badge

Hi there @Leslie Nicole,

Would you mind sharing a screenshot of the error message you get after following the instructions above?

 

 

Userlevel 4
Badge +4

Hey @Leslie Nicole,

So the reason behind why you are encountering this issue come down to how Shopify 2.0 and Klaviyo integrate and what code to use to implement viewed product.

In our documentation regarding this topic, please note that 2.0 themes don't have the same implementation method for viewed product compared to other themes. For Shopify 2.0 themes, it is required for a custom liquid block to be integrated as well. 

I would just review your code, make sure syntax and formatting is preserved when pasting in code, and check over our instructions on our documentation regarding 2.0 themes as well.

 

Thank you!
Alex

Reply