This feature can identify category views for both unknown, non-logged in users (Grow contacts) and known, non-logged in customers (emails in your suppression list).
NOTE: We must enable this feature for you. If you’ve not already spoken with someone on our team, please ensure you request that we enable this for you.
To use this feature, you must first ensure that you’re using the most recent version of our script on your website. The base script must fire before the Category Views script. You can find your script in your Retention.com account under Code Script > View Script. Click here for a link to all our tutorials on how to add the script to your site, in case you need a refresher.
If you're using our custom Shopify Integration app, the Category Views script will automatically be installed. For those not using this app, view the "On your website" section at the bottom.
Once our custom Shopify Integration app is set up and we have enabled this feature, it's time to create or clone your Viewed Category Flow in Klaviyo.
4. Now, add your Viewed Category abandonment emails.
There are two options for updating your Viewed Product events for Reclaim:
1. Locate your Category tracking snippet from Klaviyo. If you are using Shopify, this should be located in the liquid template for the category page(s). The Viewed Category tracking snippet that you need to locate should look something like this:
_learnq.push(['track', 'Viewed Category', categoryItem]);
Note: If you do not have a Viewed Category tracking snippet installed, skip to Step 3 below.
Here’s an example of what a full snippet with category data might look like if there's an existing Viewed Category Tracking Script:
<script type="text/javascript"> var _learnq = _learnq || []; var categoryInfo = { "CategoryName": "Puzzles", "CategoryURL": "http://www.example.com/category", }; _learnq.push(["track", "Viewed Category", categoryItem]); </script>
2. Add the following script to the your existing Viewed Category tracking snippet in Klaviyo:
<script>geq.event("Viewed Category Reclaim', categoryItem);</script>
So the whole thing should look like this if you have an existing Viewed Category tracking script (we’ve not included the additional details for price, image URL, etc here):
_learnq.push(['track', 'Viewed Category', categoryItem]); geq.event('Viewed Category Reclaim', categoryItem);
3. If you do not have an existing Viewed Category tracking script, add this script to the theme:
{% if product %}
<script type="text/javascript">
var item = {
Name: {{ product.title|json }},
ProductID: {{ product.id|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 }}
};
geq.event('Viewed Category Reclaim', categoryItem);
</script>
{% endif %}
Once this script update has been implemented properly, and the event is triggered, you will see this new metric populate in Klaviyo.