Solved

Tracking events across sub-domains

  • 19 October 2021
  • 5 replies
  • 163 views

Badge

I have shop with checkout happening on separate sub domain, it seems like Klaviyo tracks only on domain user was created.

 

example:

a.com (Klaviyo form)

check.a.com

 

Here all activities of a.com are tracked for a user created via Klaviyo form; while when user moves to  check.a.com - nothing is tracked.

icon

Best answer by stephen.trumble 19 October 2021, 22:56

View original

5 replies

Userlevel 6
Badge +50

Hey @alenjose 

Great question to ask the Klaviyo Community for help with! There have been a few people who have had the same question as you. Hope I can help you start that process to solve this challenge.

When your check out is hosted on a different subdomain, it requires a custom code that allows the Klaviyo cookie to be tracked across your subdomains. @Dov  responded to this same question on this community post with the custom code and where it needs to go on your site: 

Please give this a thorough read through as it should fix your challenge. We are always here for you if you in the Klaviyo Community if you find yourself with more questions or challenges!

Badge

Thank you

Badge

@stephen.trumble  I couldn’t fully test this as to counter the issue we actually designed flow to get user land on checkout sub-domain to get  cookie. 

 

But even with this script I don’t see the cookie’s domain with dot. 

Example if I am my site is https://abc.com

 __kla_id   cookie is always set for abc.com  while it should be .abc.com  to work well in all sub-domains.  is there any script modifications to do this? 

Badge

@stephen.trumble  do you have any other solution?  Looks like overall most flows are broken for us in production. I tried above script too but its not working. Is there any manual way of assigning cookie ids?

 

Our flow got 3 applications - 2 WordPress and 1 Odoo

Userlevel 6
Badge +50

@stephen.trumble  do you have any other solution?  Looks like overall most flows are broken for us in production. I tried above script too but its not working. Is there any manual way of assigning cookie ids?

 

Our flow got 3 applications - 2 WordPress and 1 Odoo

Hey @alenjose 

Unfortunately if the workarounds that were already shared haven’t worked, I do not know of any other workaround other than having an account for each subdomain. So, within your Klaviyo account you are only able to have one subdomain connected. While you can use different sender email addresses in the various messages, at this time multiple subdomains are not supported.  I understand that this might not be an ideal response, but setting up an account for each would be the quickest resolution currently. If you are the owner of the accounts, you can work with the Klaviyo Support team to clone templates, flows and campaigns to the new accounts so you do not have to painstakingly reproduce your content.

Reply