Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- *
- * This code helps to do cross domain tracking for both urls.
- *
- * The code will be in charge of detecting the right domain and
- * to fire the proper tracking code.
- *
- * REMEMBER TO REPLACE THE TRACKING CODE
- **/
- // Detecting domain
- var gaDomainDetect = document.domain;
- // Firing the proper events
- if (gaDomainDetect == 'stem.discoveryeducation.com')
- {
- ga('create', 'UA-12418696-1', 'auto', {'allowLinker': true});
- ga('require', 'linker');
- ga('linker:autoLink', ['siemensstemacademy.com'] ); // Note that here goes the other domain
- }
- else if(gaDomainDetect == 'siemensstemacademy.com')
- {
- ga('create', 'UA-12418696-1', 'auto', {'allowLinker': true});
- ga('require', 'linker');
- ga('linker:autoLink', ['stem.discoveryeducation.com'] );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement