Solved

Custom Integration with Klaviyo Not Showing Data: Need Help with 'Viewed Product' Tracking

  • 15 September 2023
  • 2 replies
  • 334 views

Badge

I have a custom-built e-commerce website, so I can't use built-in integration solutions. I've created the 'Viewed Product' tracking on the client side, with guidance from the Klaviyo article: “Integrate a platform without a pre-built Klaviyo integration” that can be found here:

https://developers.klaviyo.com/en/v1-2/docs/guide-to-integrating-a-platform-without-a-pre-built-klaviyo-integration

I have this in the header of my website:

<script type="text/javascript" async="" src="https://static.klaviyo.com/onsite/js/klaviyo.js?company_id=xxxxx"></script>

and this in the body of my product page:

 <script>
            var _learnq = _learnq || [];
            var item = {
                "ProductName": "Color Bracelet",
                "ProductID": "25100",
                "SKU": "10210",
                "Categories": [["therapy","bracelets"]],
                "ImageURL": "https://www.imageurl.com",
                "URL": "https://www.websiteurl.com?productid=25100",
                "Brand": "",
                "Price": 19.95,
            };
            _learnq.push(["track", "Viewed Product", item]);

       </script>

I can't find any errors, yet I'm not receiving any data on the Klaviyo Analytics Dashboard. Can anyone help me figure out what the issue is?

I'm also uncertain about which page in Klaviyo analytics displays the data for the 'Viewed Product' events. According to the documentation when navigating to Analytics > Metrics and then Filter by API - then it should have a metric name called “Viewed Product” - but I can only find one called “Active on Site”

Thanks in advance for your help

icon

Best answer by David To 15 September 2023, 16:34

View original

2 replies

Badge

Suddenly it started tracking - I am not sure why - but it works as it should now :-)

Userlevel 7
Badge +60

Hey @it magic,

Thanks for providing an update in the Community!

Just to provide some clarity on what the issue may have been for other Community members. In my experience, this is common if after adding the code, the browser you’re testing on has not been cookied. 

It’s also important to note that the event will only track cookied users who visit the product page. Additionally, it would only track users since they’ve been cookied and does not retroactively record product pages viewed prior. 

When testing, we suggest taking the steps below as mentioned in our Troubleshooting viewed product tracking Help Center article:

Test Viewed Product tracking

To test that your Viewed Product tracking is set up properly, follow these steps:

  1. Navigate to your website
  2. On your homepage, add the following to the end of the URL, replacing testing.email@gmail.com with your email address:
    ?utm_email=testing.email@gmail.com
    Shopify test store with ?utm_email=example@gmail.com appended to URL
  3. Reload the page
  4. Navigate to a product page on your site
  5. Search in Klaviyo for your email address
    Top corner of Klaviyo dashboard with testing.email@gmail.com in search bar

You should see that a Klaviyo profile has been created for you (if one didn't exist already) and that this product view has been tracked on your activity feed.

To see a feed of all Viewed Product metrics over time:

  1. Click the Analytics dropdown in Klaviyo and select Metrics
  2. Filter by Viewed Product to view tracked data in an activity feed, activity map, charts, best people, and cohort reports
    Metrics tab in Klaviyo with Viewed Product in search bar and Viewed Product in results with gear icon

Once you’ve reviewed the troubleshooting scenarios below and made changes, you should test your tracking again to make sure it’s working correctly. 

 

Thanks for being a part of the Klaviyo Community!

David

 

Reply