Hey there @Fashionshop123,
Welcome and thank you for posting to the Community!
It looks like you might be using Shopify 2.0. In Shopify 2.0 you edit code in JSON instead of Liquid template theme files within Shopify. 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 being 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:
*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:
In this example, it is the product-template.liquid section file that we would open up, and search for the characters
'{ schema %}'
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.
When product page tracking is installed, a Viewed Product metric will be tracked whenever an identifiable browser views a product page on your website.
After enabling tracking on your site, you can test that tracking is set up properly by following these steps:
- Navigate to your website
- Add the following to the end of your store url, replacing example@gmail.com with your email address:
?utm_email=example@gmail.com - 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.
Over time, to see a live feed of all tracked activity for the Active on Site and Viewed Product metrics, when you navigate to the Activity Feed on your dashboard. Here, you can filter for the metric of your choice by clicking into the dropdown menu next to Showing Feed for. You can also navigate to the Analytics tab of your account and click on each metric to analyze tracked data through an activity feed, activity map, charts, best people, and cohort reports.
When you add Klaviyo's web tracking to your site, we only track the browsing activity of "known browsers" — i.e. browsers that have visited and engaged at least once before. Klaviyo will not track anonymous browsers.
There are three key ways Klaviyo will be able to identify a site visitor for web tracking purposes:
- If someone has, at some point, clicked through a Klaviyo email to your website
- If someone has, at some point, subscribed/opted-in through a Klaviyo form
- If someone has, at some point, logged into your site and you have identify tracking installed
As a result, until you start sending emails with Klaviyo and growing your lists, you probably won't see a lot of tracked web activity. Over time, Klaviyo will identify more and more of your contact-base and your web tracking data will become more comprehensive.
If you wish to troubleshoot your viewed product tracking, I recommend checking out this documentation.
Hope this helped!
Alex
Very detailed answer, everything is working. Thank you!
When you add Klaviyo's web tracking to your site, we only track the browsing activity of "known browsers" — i.e. browsers that have visited and engaged at least once before. Klaviyo will not track anonymous browsers.
There are three key ways Klaviyo will be able to identify a site visitor for web tracking purposes:
- If someone has, at some point, clicked through a Klaviyo email to your website
- If someone has, at some point, subscribed/opted-in through a Klaviyo form
- If someone has, at some point, logged into your site and you have identify tracking installed
As a result, until you start sending emails with Klaviyo and growing your lists, you probably won't see a lot of tracked web activity. Over time, Klaviyo will identify more and more of your contact-base and your web tracking data will become more comprehensive.
@alex.hong Question on this as I’m running into the same issue, Klaviyo itself has a setting for “anonymous visitor tracking”. Maybe that wasn’t there yet 2 years ago? I would expect if you enable this that it would do what it says: whenever a person converts (e.g. orders on shopify) that it would also bring in that historic data and not just show checkout and ordered product events.
Also a shopify - klaviyo integration.
When I do the test with described with the emailadress, I can see active on site and viewed product events appearing in klaviyo, so according to this the setup should be correct? However in the last month we have only gathered 3 active on site events (me, colleague and 1 other person). So something does not add up. There is a decent amount of sessions and on average 20 checkout events per day.