Solved

API + GTM Integration (identify)

  • 26 August 2021
  • 3 replies
  • 363 views

Badge +2

Hi,

we are implementing Klaviyo to a custom ecommerce platform. For now we have implemented the “Placed Order” event, which is working fine and it sent from our backend. 

Now we would like to implement “Active on Site” and “Add to cart” via Google Tag Manager. We have the codes in GTM and events are firing, but I think the problem is that the user is not identified properly. We do it like this:

When the user submits an order via website, Placed Order event and Identify request are sent via API. 

The user then browses on the website, but Klaviyo does not recognize him.

How to debug? What are we doing wrong? :) 

Thanks!

icon

Best answer by retention 31 August 2021, 17:47

View original

3 replies

Userlevel 7
Badge +60

Hey @tomazs !

Thank you so much for reaching out to the Klaviyo Community for help with this! Happy to help!

Just to confirm, you have used the Add to Cart and Active on site code snippets from guide on How to Add Klaviyo Web Tracking Using Google Tag Manager?

If you have and they are not functioning properly, you can forgo using GTM all together and use the Guide to Integrating a Standard eCommerce Platform which may help.

I would also reach out to the developer who created the custom ecommerce platform to help troubleshoot this further. Hope this helps get you back on track!

Thank you for being a part of the Klaviyo Community! 

 

Badge +2

Hi,

yes, about the GTM integration - we have implemented it in the way as in the article. The problem is, the testing does not work - with utm_email parameter, nothing appears in Klaviyo Activity Feed.

Is the problem maybe that we are testing this on localhost? But “Placed Order” events works fine via API from localhost.

Thanks

Userlevel 7
Badge +57

@tomazs - I’m not sure if this would be helpful, but there’s an API to check if a user is “identified” or not.  You can do this in Javascript by running _learnq.isIdentified() and it will return a true or false value.

As a side note, I think testing on localhost might be an issue, since the localhost top-level domain might not match the information in your Klaviyo account without the proper Cross Origin Requests Sharing (CORS) mechanism. 

Another possibility is Klaviyo’s Javascript can’t resolve localhost to a valid domain. A domain, by definition, needs at least 1 or more “dots” in it - unless you are doing some domain binding in your host file.  
I’d start by seeing if you can test your implementation on a subdomain of your site or try setting up a host file (/etc/host) to see if that would work.  

Reply