Solved

Why are our events not coming through

  • 2 March 2021
  • 3 replies
  • 662 views

Userlevel 1
Badge +2

Hi,

for some reason even though we our users are identified via `_learnq.push([identify, '$email' : '{{ customer.email }}' ]) none of the data is coming through, we have events for: Viewed item, Added to cart, Added to wishlist and more.

Even when I manually type the code on the console to identify my email address and try to push an event it just doesn’t show up on klaviyo.

Anyone else had problems with this before?

icon

Best answer by cbarley 2 March 2021, 16:27

View original

3 replies

Userlevel 3
Badge +5

Hey @IanHogers, A couple questions/points for you:

  1. When you paste the code 
    _learnq.push([identify, '$email' : '{{ customer.email }}' ]);

    be sure to add quotes around “identify”
  2. When you test that code in the console, are you replacing {{ customer.email }} with an actual email address? If not, you should do that for testing purposes. The Javascript console doesn’t know how to to parse the {{ }} characters since those are particular to Shopify and aren’t native Javascript characters. 
  3. A possible easier way to “identify” yourself in the browser if you’re looking to test to see if you’re getting properly cookied, which is the equivalent to pasting in that _learnq.push code you provided is to actually just add your email into your own URL with the Klaviyo tracking code on it like this: https://yourwebsite.com?utm_email=youremailgoeshere

    Corresponding article here
  4. Finally, do you happen to have the page that you’re looking at to test so that I can take a look here?

Thanks!

Userlevel 1
Badge +2

Hi,

We realised something, the shopify 

{% customer %}

Object is not actually available within theme.js.liquid as that’s where we were triggering the ‘identify’

Thanks for the answers!

Userlevel 5
Badge +8

Hi there,

Thanks for sharing with the Community! Is that the exact code snippet you’re using? If not, can you provide the entire snippet? If you can provide the link to the site where the code is live, that would also be helpful.

Best,

Caroline

Reply