forked from googleanalytics/autotrack
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request googleanalytics#24 from googleanalytics/provide-order
Allow sourcing autotrack.js before the snippet
- Loading branch information
Showing
6 changed files
with
115 additions
and
7 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<!doctype html> | ||
<html> | ||
<body> | ||
|
||
<script> | ||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | ||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | ||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | ||
})(window,document,'script','//www.google-analytics.com/analytics.js','_ga'); | ||
|
||
_ga('create', 'UA-XXXXX-Y', 'auto'); | ||
_ga('require', 'autotrack'); | ||
|
||
// Note(philipwalton): | ||
// Selenium on Windows 10 Edge doesn't handle arrays well, so we fake it. | ||
var hitData = {count: 0}; | ||
_ga('set', 'sendHitTask', function(model) { | ||
hitData[hitData.count] = { | ||
hitType: model.get('hitType') | ||
}; | ||
hitData.count++; | ||
}); | ||
</script> | ||
|
||
<script async src='//www.google-analytics.com/analytics.js'></script> | ||
<script async src="/autotrack.js"></script> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!doctype html> | ||
<html> | ||
<body> | ||
|
||
<script src="/autotrack.js"></script> | ||
|
||
<script> | ||
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date; | ||
|
||
ga('create', 'UA-XXXXX-Y', 'auto'); | ||
ga('require', 'autotrack'); | ||
|
||
// Note(philipwalton): | ||
// Selenium on Windows 10 Edge doesn't handle arrays well, so we fake it. | ||
var hitData = {count: 0}; | ||
ga('set', 'sendHitTask', function(model) { | ||
hitData[hitData.count] = { | ||
hitType: model.get('hitType') | ||
}; | ||
hitData.count++; | ||
}); | ||
</script> | ||
|
||
<script async src='//www.google-analytics.com/analytics.js'></script> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters