Skip to content

Commit 58dd3cd

Browse files
authored
Update analytics (#1217)
1 parent 603773e commit 58dd3cd

File tree

1 file changed

+11
-21
lines changed

1 file changed

+11
-21
lines changed

_templates/layout.html

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,6 @@
22

33
{% block footer %}
44
{{ super() }}
5-
<script>
6-
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
7-
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
8-
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
9-
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
10-
11-
ga('create', 'UA-90545585-2', 'auto');
12-
ga('send', 'pageview');
13-
14-
</script>
15-
165
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-117752657-2"></script>
176

187
<script>
@@ -45,12 +34,12 @@
4534
tutorialLink: window.location.href,
4635
downloadTitle: $(this).attr("data-response")
4736
});
48-
ga('send', {
49-
hitType: 'event',
50-
eventCategory: 'Download',
51-
eventAction: 'click',
52-
eventLabel: $(this).attr("data-response")
37+
38+
gtag('event', 'click', {
39+
'event_category': 'Download',
40+
'event_label': $(this).attr("data-response")
5341
});
42+
5443
gtag('event', 'click', {
5544
'event_category': $(this).attr("data-response"),
5645
'event_label': $("h1").first().text(),
@@ -61,17 +50,18 @@
6150
$("[data-behavior='was-this-helpful-event']").on('click', function(){
6251
$(".helpful-question").hide();
6352
$(".was-helpful-thank-you").show();
53+
6454
fbq('trackCustom', "Was this Helpful?", {
6555
tutorialLink: window.location.href,
6656
tutorialTitle: $('h1:first').text(),
6757
helpful: $(this).attr("data-response")
6858
});
69-
ga('send', {
70-
hitType: 'event',
71-
eventCategory: 'Was this Helpful?',
72-
eventAction: 'click',
73-
eventLabel: $(this).attr("data-response")
59+
60+
gtag('event', $(this).attr("data-response"), {
61+
'event_category': 'Was this Helpful?',
62+
'event_label': $(this).attr("data-response")
7463
});
64+
7565
gtag('event', $(this).attr("data-response"), {
7666
'event_category': 'Was this Helpful?',
7767
'event_label': $("h1").first().text()

0 commit comments

Comments
 (0)