diff options
| author | Andrew Lee <alee14498@gmail.com> | 2019-10-27 09:57:37 -0400 |
|---|---|---|
| committer | Andrew Lee <alee14498@gmail.com> | 2019-10-27 09:57:37 -0400 |
| commit | e62e7bb6b14555c9bbe5d40d217103984f4f80e6 (patch) | |
| tree | 21887d847dccacb47644eb6f74ce31326172303c /_includes/analytics-providers | |
| parent | 716ea6ed2b64c921a799d872a07bfbd53b2a3e58 (diff) | |
| download | pokeworld-website-e62e7bb6b14555c9bbe5d40d217103984f4f80e6.tar.gz pokeworld-website-e62e7bb6b14555c9bbe5d40d217103984f4f80e6.tar.bz2 pokeworld-website-e62e7bb6b14555c9bbe5d40d217103984f4f80e6.zip | |
Rewrite progress
Diffstat (limited to '_includes/analytics-providers')
| -rw-r--r-- | _includes/analytics-providers/custom.html | 3 | ||||
| -rw-r--r-- | _includes/analytics-providers/google-gtag.html | 9 | ||||
| -rw-r--r-- | _includes/analytics-providers/google-universal.html | 7 | ||||
| -rw-r--r-- | _includes/analytics-providers/google.html | 14 |
4 files changed, 33 insertions, 0 deletions
diff --git a/_includes/analytics-providers/custom.html b/_includes/analytics-providers/custom.html new file mode 100644 index 0000000..c34b97a --- /dev/null +++ b/_includes/analytics-providers/custom.html @@ -0,0 +1,3 @@ +<!-- start custom analytics snippet --> + +<!-- end custom analytics snippet -->
\ No newline at end of file diff --git a/_includes/analytics-providers/google-gtag.html b/_includes/analytics-providers/google-gtag.html new file mode 100644 index 0000000..16d0cf1 --- /dev/null +++ b/_includes/analytics-providers/google-gtag.html @@ -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> diff --git a/_includes/analytics-providers/google-universal.html b/_includes/analytics-providers/google-universal.html new file mode 100644 index 0000000..68c2674 --- /dev/null +++ b/_includes/analytics-providers/google-universal.html @@ -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> diff --git a/_includes/analytics-providers/google.html b/_includes/analytics-providers/google.html new file mode 100644 index 0000000..c5742b9 --- /dev/null +++ b/_includes/analytics-providers/google.html @@ -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> |
