Skip to content

Commit 6fb1770

Browse files
committedMar 4, 2020
add GA event tracking
1 parent 2534895 commit 6fb1770

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
 

โ€Ž_templates/layout.html

+24
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,29 @@
1111
ga('create', 'UA-71919972-3', 'auto');
1212
ga('send', 'pageview');
1313

14+
$("[data-behavior='call-to-action-event']").on('click', function(){
15+
ga('send', {
16+
hitType: 'event',
17+
eventCategory: 'Download',
18+
eventAction: 'click',
19+
eventLabel: $(this).attr("data-response")
20+
});
21+
});
22+
23+
$("[data-behavior='was-this-helpful-event']").on('click', function(){
24+
$(".helpful-question").hide();
25+
$(".was-helpful-thank-you").show();
26+
ga('send', {
27+
hitType: 'event',
28+
eventCategory: 'Was this Helpful?',
29+
eventAction: 'click',
30+
eventLabel: $(this).attr("data-response")
31+
});
32+
});
33+
34+
if (location.pathname == "/") {
35+
$(".helpful-container").hide();
36+
$(".hr-bottom").hide();
37+
}
1438
</script>
1539
{% endblock %}

0 commit comments

Comments
 (0)
Please sign in to comment.