Solved

Track same user for two domains with new klaviyo object

  • 24 May 2023
  • 3 replies
  • 211 views

Badge
  • Contributor I
  • 4 replies

How to track same user for two domains with new klaviyo library.

icon

Best answer by Brian Turcotte 31 May 2023, 19:43

View original

3 replies

Userlevel 7
Badge +36

Hi @web!

 

Let me check on this for you with Engineering, and I will update the thread as soon as possible!

 

Best,

Brian

 

Badge

Hi @Brian Turcotte 

Did you check the above query with Engineering?

Userlevel 7
Badge +36

​Hi @web!

 

The task you’re describing can be challenging - but I can definitely provide some resources and direction. Also - I would keep in mind that this constitutes a custom use case, so there is only so much guidance that Community and/or Support can offer.

 

For starters, this Community thread gives a pretty good idea of the how to accomplish this:

 

You will essentially have to grab the exchange ID from the cookie in the first domain, then use the following API endpoint to exchange that for the Profile ID, which you can use to identify the profile on the next domain:

 

The exchange ID is stored within the cookie, and you can test this behavior by following these steps (after cookie-ing yourself):

  • in chrome, right click > inspect
  • locate the network tab in the window that just opened
  • look for the "track" network call in the list and click "payload" and find the one that has _activity__  in it

It will look something like this:


You can retrieve and decode the cookie programmatically by implementing the solution from the aforementioned community post, specifically this script:

_learnq.push(["_getIdentifiers"]).$exchange_id

 

Since this can warrant extensive custom development, you’re always welcome to reach out to one of our wonderful Official Klaviyo Partners for further help.

 

I hope this helps to get you started, and thanks for using the Community!

- Brian

Reply