SOLVED

Cookie based UTM tracking

Go to solution
SanfordWhiteman
Level 10 - Community Moderator

Re: Cookie based UTM tracking

Working as expected for me.

 

(1) Navigated to:

https://gimessentials.acquire.com.au/gim-essentials-transforms-geological-data-management-processes/?utm_medium=my-medium&utm_source=my-source

 

(2) Observed query string persisted to localStorage:

SanfordWhiteman_1-1723182563727.png

 

(3) Within the next few seconds, navigated to:

https://gimessentials.acquire.com.au/

 

(4) Observed the persisted query params immediately restored to current URL:

SanfordWhiteman_2-1723182649246.png

 

(5) Observed the corresponding hidden fields populated on both forms from query params, per Form Editor config:

SanfordWhiteman_3-1723182793152.png

 

 

 

 

KyleacQuire
Level 2

Re: Cookie based UTM tracking

Ahh, I change the hidden fields in the form to capture Cookie parameters, before I had it just on URL parameters so it didn't write. Tested, and working.

 

Thank you so much for that help! Amazing

 

 

SanfordWhiteman
Level 10 - Community Moderator

Re: Cookie based UTM tracking

Not sure I understand your response. The form must fill from query params. Cookies are not used by this code.

 

 

KyleacQuire
Level 2

Re: Cookie based UTM tracking

Yeah ignore that post. I was thinking about cookies again.

 

I have managed to set up the Javascript across a couple of domains and it looks like its working, fantastic. Is it possible to also carry forward UTM's across domains.

For example, a user goes from our primary domain acquire.com.au to market landing page URLs page.acquire.com.au?

SanfordWhiteman
Level 10 - Community Moderator

Re: Cookie based UTM tracking

The code could be expanded to do this, naturally using cookies as that's the only storage mechanism allowed to be used across origins (as long as the origins share a private parent domain, as in your example).
KyleacQuire
Level 2

Re: Cookie based UTM tracking

Do you also have code written for this scenario?

SanfordWhiteman
Level 10 - Community Moderator

Re: Cookie based UTM tracking


Do you also have code written for this scenario?

When falling back on cookies I have a whole other JS library with more features. But this simple forwarder could be enhanced with cookie support. Will add that at some point.