Skip to content

Commit

Permalink
Merge pull request #12 from DFE-Digital/analytics
Browse files Browse the repository at this point in the history
set gtag url
  • Loading branch information
sfawcett123 authored May 22, 2020
2 parents 04a6b1e + 3df00e9 commit ef3df69
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/webpacker/packs/google_analytics.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
document.addEventListener("turbolinks:load", function () {
gtag("config", "UA-159214613-3");
document.addEventListener("turbolinks:load", function (event) {
if (typeof gtag === "function") {
gtag("set", "location", event.data.url);
gtag("send", "pageview");
}
});

0 comments on commit ef3df69

Please sign in to comment.