Skip to content

Commit

Permalink
Merge pull request #349 from sylhare/analytics
Browse files Browse the repository at this point in the history
Add dual tagging
  • Loading branch information
sylhare authored May 28, 2022
2 parents 33e2799 + d48f0cf commit cd53e75
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions _includes/default/head.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
const cookieName = 'cookie-notice-dismissed-{{ site.url }}';
const isCookieConsent = '{{ site.cookie_consent }}';
const analyticsName = '{{ site.google_analytics }}';
const analyticsNameGA4 = '{{ site.google_analytics_ga4 }}';
</script>

{% if site.cookie_consent %}
Expand Down
1 change: 1 addition & 0 deletions assets/js/partials/cookie_consent_init.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ function googleAnalytics() {
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', analyticsName);
gtag('config', analyticsNameGA4, { 'anonymize_ip': true });

// Google analytics
window.ga = window.ga || function () { (ga.q = ga.q || []).push(arguments) };
Expand Down

0 comments on commit cd53e75

Please sign in to comment.