forked from 18F/uswds-jekyll
-
Notifications
You must be signed in to change notification settings - Fork 22
/
analytics.html
17 lines (15 loc) · 953 Bytes
/
analytics.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{% if site.google_analytics_ua %}
<!-- Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics_ua }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
// `forceSSL` was used for analytics.js (the older Google Analytics script). It isn't documented for gtag.js, but the term occurs in the gtag.js code; figure it doesn't hurt to leave it in. -@afeld, 5/29/19
gtag('config', '{{ site.google_analytics_ua }}', { 'anonymize_ip': true, 'forceSSL': true });
</script>
{% endif %}
{% if site.dap_agency %}
<!-- Digital Analytics Program roll-up, see https://analytics.usa.gov for data -->
<script id="_fed_an_ua_tag" src="https://dap.digitalgov.gov/Universal-Federated-Analytics-Min.js?agency={{ site.dap_agency }}{% if site.dap_subagency %}&subagency={{ site.dap_subagency }}{% endif %}"></script>
{% endif %}