Skip to content

Commit

Permalink
Update to current analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaneCurcuru committed Sep 13, 2023
1 parent ce11c58 commit 8f7812a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
6 changes: 3 additions & 3 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ social:

# Analytics
analytics:
provider : "google-universal" # false (default), "google", "google-universal", "custom"
google:
tracking_id : "UA-6070690-5"
provider : "custom" # false (default), "google", "google-universal", "custom"

google_analytics: "G-B7TVHGXVJZ"


# Site Author
Expand Down
12 changes: 10 additions & 2 deletions _includes/analytics-providers/custom.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
<!-- start custom analytics snippet -->
{% if site.google_analytics %}
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

<!-- end custom analytics snippet -->
gtag('config', '{{ site.google_analytics }}');
</script>
{% endif %}

0 comments on commit 8f7812a

Please sign in to comment.