Skip to main content

I’m having an issue with my Viewed Product and Added To Cart metrics being recorded twice for a single Shopify event which is playing havoc with my flows. I have the standard Shopify integration live which pulls through everything perfectly, but I’m also getting a duplicate metric recorded which doesn’t have the variables I need or has them formatted in an unusable way. 


Klaviyo support were able to identify the source of the other metric as coming from this line of code, which is the Shopify native tracking solution Trekkie.

This code is added via {{ content_for_header }} in the theme.liquid, which inserts this tracking code plus a whole lot of other core functionality to the site as well, so I can’t just get rid of it. Any suggestions on how I can resolve this? I don’t understand how this can only be happening with me when the Trekkie script is installed on all Shopify sites?

Hi ​@DannySt !

Thank you for reaching out to the Community. Since this is a Shopify code that can’t necessarily be removed, there is not much we can do within Klaviyo to prevent this, but what you can do is add a filter to both your ‘Added to Cart’ flow and ‘Viewed Product’ flow that prevents profiles from being able to enter the flow more than once within a certain amount of time. For example: 

I hope this helps, and I will leave this thread open for now in case any other Community members have identified a workaround or solution for this! 


Welcome to the community ​@DannySt 

As ​@emma.owens states, adding that filter will prevent a profle from entering the flow multiple times each time the metric is triggred and receving multiple messages. It is also generally best practice for metric triggered flows to add that filter. That would solve your issue.

However, re your duplicate events: I am unabe to identify any instances of Shopify sites with Klaviyo that I manage that have a duplicate Viewed product event that is not Klaviyo’s. They all have the Trekkie scripts too.

My understanding is that these scripts push data to Shopify’s analytics and not to Klaviyo. It may be that the non-Klaviyo event you’re seeing is being pushed from another app on your store.

Alternatively I wonder if you have old duplicate Klaviyo tracking scripts in your store code (or injected via Google Tag manager)? Those scripts used to be added manually before Klaviyo moved to app embed.

The utm_source in your screengrab for that event is hidden. Does that have any value in it that may help identify where it’s coming from?

Regards

Andy


Reply