You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Google recently launched GA4 analytics. While the present al-folio version supports Google analytics, a simple change in analytics.html activates GA4 analytics too.
In the _config.yml file, add the following line at a convenient place:
ga4_analytics: G-XXXXXXXXXX #This is your GA4 measurement ID
Now, go to _includes/scripts/analytics.html and add the following (maybe just below the current gtag.js:
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.ga4_analytics }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{{ site.ga4_analytics }}');
</script>
Then, commit and push. Done.
The text was updated successfully, but these errors were encountered:
Seems like GA4 analytics use the same scripts as previous Google Analytics. In that case, I don't think we need to make any more changes. Just adding a note in the _config.yml and probably changing the ID to G-XXXXXXXXXX will make thing clear.
Google recently launched GA4 analytics. While the present al-folio version supports Google analytics, a simple change in analytics.html activates GA4 analytics too.
In the _config.yml file, add the following line at a convenient place:
ga4_analytics: G-XXXXXXXXXX #This is your GA4 measurement ID
Now, go to _includes/scripts/analytics.html and add the following (maybe just below the current gtag.js:
Then, commit and push. Done.
The text was updated successfully, but these errors were encountered: