Skip to content

Instantly share code, notes, and snippets.

@Nils-van-Kleef
Last active June 27, 2016 16:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save Nils-van-Kleef/eff9d4456bb0e43b7221 to your computer and use it in GitHub Desktop.
Save Nils-van-Kleef/eff9d4456bb0e43b7221 to your computer and use it in GitHub Desktop.
// Harrisons latest version: https://gist.github.com/harrisonkrat/6519d49b7102f361c992
@harrisonkrat
Copy link

Hi @nils, I created a new fork here - I think we need to refer to window.whatReferrer in the variation code to access that variable.

@Nils-van-Kleef
Copy link
Author

@harrisonkrat I updated this code snippet too with it. Thanks for the update!

@circAssimilate
Copy link

@nils, can we put line 38 in experiment JS instead?

@Nils-van-Kleef
Copy link
Author

@circAssimilate: I learned from @harrisonkrat that this is not possible. Our current Project JS code doesn’t have anything in place that checks if a redirect is running; it just globally gets and sets some cookies for referrer. The variation code is what actually sends the info to GA, and that’s the only place we want it to happen because that is where we know a redirect is happening.

@harrisonkrat
Copy link

@nils I updated my original comment in ECO-878 and my fork here. This code has been confirmed to work by Progress/Telerik and Practice Fusion.

Progress did some extra modifications in their GTM implementation, but the core idea of the code is there. Practice Fusion doesn't have Project JS, so they implemented this code directly on their site.

@Nils-van-Kleef
Copy link
Author

Thanks @harrisonkrat! I've updated my gist to match yours so I don't have to worry about giving out the wrong code.

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