generated from alpha-canada-ca/.github
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Update analytics providers (#27)
Added Google in the list of providers for analytics
- Loading branch information
David Elisma
committed
Jun 7, 2021
1 parent
5c28bc2
commit cd26c8e
Showing
4 changed files
with
33 additions
and
3 deletions.
There are no files selected for viewing
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,9 @@ | ||
<!-- Global site tag (gtag.js) - Google Analytics --> | ||
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.analytics.google.tracking_id }}"></script> | ||
<script> | ||
window.dataLayer = window.dataLayer || []; | ||
function gtag(){dataLayer.push(arguments);} | ||
gtag('js', new Date()); | ||
|
||
gtag('config', '{{ site.analytics.google.tracking_id }}', { 'anonymize_ip': {{ site.analytics.google.anonymize_ip | default: false }}}); | ||
</script> |
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,7 @@ | ||
<script> | ||
window.ga=function(){ga.q.push(arguments)};ga.q=[];ga.l=+new Date; | ||
ga('create','{{ site.analytics.google.tracking_id }}','auto'); | ||
ga('set', 'anonymizeIp', {{ site.analytics.google.anonymize_ip | default: false }}); | ||
ga('send','pageview') | ||
</script> | ||
<script src="https://www.google-analytics.com/analytics.js" async></script> |
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,14 @@ | ||
<script> | ||
var _gaq = _gaq || []; | ||
_gaq.push(['_setAccount', '{{ site.analytics.google.tracking_id }}']); | ||
{% if site.analytics.google.anonymize_ip == true %} | ||
_gaq.push(['_gat._anonymizeIp']); | ||
{% endif %} | ||
_gaq.push(['_trackPageview']); | ||
|
||
(function() { | ||
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; | ||
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; | ||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); | ||
})(); | ||
</script> |