-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from codeplaysoftware/google-analytics-tracking
Google Analytics Support
- Loading branch information
Showing
9 changed files
with
336 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
url: https://www.syclops.org | ||
|
||
# Google Analytics Token | ||
ga: 'G-CZ9WF91EQN' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<div id="cookies-accept-dialog"> | ||
<div> | ||
<h1>Cookies</h1> | ||
<p>Please note that we use cookies on this website to enhance your experience, provide features and to track how | ||
the website is used.</p> | ||
<p>Please click <b>accept</b> to accept our privacy & cookie polices or click <b>decline</b> to disable | ||
cookies and related features. </p> | ||
<ul> | ||
<li><a href="/privacy/">Privacy Policy</a></li> | ||
<li><a href="/cookies/">Cookie Policy</a></li> | ||
</ul> | ||
<div class="buttons"> | ||
<button class="accept">Accept</button> | ||
<button class="reject">Decline</button> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
$(() => { | ||
const cookies = $('#cookies-accept-dialog').CookiesAccepted(); | ||
|
||
if(cookies.isEnabled()) { | ||
// Google Analytics | ||
const gaToken = $('body').data('ga'); | ||
window.dataLayer = window.dataLayer || []; | ||
function gtag(){dataLayer.push(arguments);} | ||
gtag('js', new Date()); | ||
gtag('config', gaToken); | ||
$.getScript('https://www.googletagmanager.com/gtag/js?id=' + gaToken); | ||
} | ||
}); |
Oops, something went wrong.