Skip to content

Commit

Permalink
Adds support for GA4 Google Analytics (#727)
Browse files Browse the repository at this point in the history
* Update `analytics.html`

* Update `config.yml`

* Update

* Update
  • Loading branch information
rohandebsarkar committed Jul 26, 2022
1 parent f618757 commit 2fadee6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ contact_note: >
# Analytics and search engine verification
# -----------------------------------------------------------------------------

google_analytics: # your google-analytics ID (format: UA-XXXXXXXXX)
google_analytics: # your Goole Analytics measurement ID (format: G-XXXXXXXXXX)
panelbear_analytics: # panelbear analytics site ID (format: XXXXXXXXX)

google_site_verification: # your google-site-verification ID (Google Search Console)
Expand Down
6 changes: 3 additions & 3 deletions _includes/scripts/analytics.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
function gtag(){ window.dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', '{{ site.google_analytics }}');
</script>
{%- endif -%}
{%- if site.enable_panelbear_analytics -%}
{%- endif -%}
{%- if site.enable_panelbear_analytics -%}
<!-- Panelbear Analytics - We respect your privacy -->
<script async src="https://cdn.panelbear.com/analytics.js?site={{site.panelbear_analytics}}"></script>
<script>
Expand Down

0 comments on commit 2fadee6

Please sign in to comment.