Skip to main content
Solved

Why are our events not coming through


IanHogers
Contributor IV
Forum|alt.badge.img+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?

Best answer by cbarley

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!

View original
Did this topic or the replies in the thread help you find an answer to your question?

3 replies

caroline
Forum|alt.badge.img+8
  • Klaviyo Alum
  • 215 replies
  • March 2, 2021

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


cbarley
Klaviyo Employee
Forum|alt.badge.img+5
  • Klaviyo Employee
  • 18 replies
  • Answer
  • March 2, 2021

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!


IanHogers
Contributor IV
Forum|alt.badge.img+2
  • Author
  • Contributor IV
  • 9 replies
  • March 5, 2021

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!