Skip to content

Instantly share code, notes, and snippets.

@mbaersch
Last active March 16, 2021 12:54
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbaersch/3deea617eeb0a8452543867a631fecd7 to your computer and use it in GitHub Desktop.
Save mbaersch/3deea617eeb0a8452543867a631fecd7 to your computer and use it in GitHub Desktop.
raw code for handling Google Analytics clientId in a separate secure https cookie and writing it to the dataLayer to be used by ga tracking tags
@awaismun
Copy link

Hi @mbaersch

Thanks for this solution. How would it work on subdomains which are not part of the same solution as the top domain? The datalayer will be lost when the user navigates from top domain to one of the subdomains which are not part of the topdomain code/solution.

Any solution for that?

@mbaersch
Copy link
Author

Hello @awaismun, just enter your domain starting with a dot to cover all hosts. See comment in the very first line 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment