Skip to content

Commit

Permalink
Update analytics (pytorch#1217)
Browse files Browse the repository at this point in the history
  • Loading branch information
patmellon authored Nov 4, 2020
1 parent 603773e commit 58dd3cd
Showing 1 changed file with 11 additions and 21 deletions.
32 changes: 11 additions & 21 deletions _templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,6 @@

{% block footer %}
{{ super() }}
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-90545585-2', 'auto');
ga('send', 'pageview');

</script>

<script async src="https://www.googletagmanager.com/gtag/js?id=UA-117752657-2"></script>

<script>
Expand Down Expand Up @@ -45,12 +34,12 @@
tutorialLink: window.location.href,
downloadTitle: $(this).attr("data-response")
});
ga('send', {
hitType: 'event',
eventCategory: 'Download',
eventAction: 'click',
eventLabel: $(this).attr("data-response")

gtag('event', 'click', {
'event_category': 'Download',
'event_label': $(this).attr("data-response")
});

gtag('event', 'click', {
'event_category': $(this).attr("data-response"),
'event_label': $("h1").first().text(),
Expand All @@ -61,17 +50,18 @@
$("[data-behavior='was-this-helpful-event']").on('click', function(){
$(".helpful-question").hide();
$(".was-helpful-thank-you").show();

fbq('trackCustom', "Was this Helpful?", {
tutorialLink: window.location.href,
tutorialTitle: $('h1:first').text(),
helpful: $(this).attr("data-response")
});
ga('send', {
hitType: 'event',
eventCategory: 'Was this Helpful?',
eventAction: 'click',
eventLabel: $(this).attr("data-response")

gtag('event', $(this).attr("data-response"), {
'event_category': 'Was this Helpful?',
'event_label': $(this).attr("data-response")
});

gtag('event', $(this).attr("data-response"), {
'event_category': 'Was this Helpful?',
'event_label': $("h1").first().text()
Expand Down

0 comments on commit 58dd3cd

Please sign in to comment.