Merge pull request #3748 from FreeCodeCamp/feature/add-ga-social-tracking
Add google analytics tracking
This commit is contained in:
@ -2,6 +2,8 @@ var main = window.main || {};
|
|||||||
|
|
||||||
main.mapShareKey = 'map-shares';
|
main.mapShareKey = 'map-shares';
|
||||||
|
|
||||||
|
main.ga = window.ga || function() {};
|
||||||
|
|
||||||
var lastCompleted = typeof lastCompleted !== 'undefined' ?
|
var lastCompleted = typeof lastCompleted !== 'undefined' ?
|
||||||
lastCompleted :
|
lastCompleted :
|
||||||
'';
|
'';
|
||||||
@ -451,6 +453,7 @@ $(document).ready(function() {
|
|||||||
'&redirect_uri=http%3A%2F%2Ffreecodecamp%2Ecom%2Fmap';
|
'&redirect_uri=http%3A%2F%2Ffreecodecamp%2Ecom%2Fmap';
|
||||||
|
|
||||||
setMapShare(challengeBlockName);
|
setMapShare(challengeBlockName);
|
||||||
|
main.ga('send', 'event', 'FB_LINK', 'SHARE', 'Facebook map share');
|
||||||
window.location.href = link;
|
window.location.href = link;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -106,7 +106,7 @@ block content
|
|||||||
if (user)
|
if (user)
|
||||||
#submit-challenge.animated.fadeIn.btn.btn-lg.btn-primary.btn-block Submit and go to my next challenge (ctrl + enter)
|
#submit-challenge.animated.fadeIn.btn.btn-lg.btn-primary.btn-block Submit and go to my next challenge (ctrl + enter)
|
||||||
if (user.progressTimestamps.length > 2)
|
if (user.progressTimestamps.length > 2)
|
||||||
a.btn.btn-lg.btn-block.btn-twitter(target="_blank", href="https://twitter.com/intent/tweet?text=I%20just%20#{verb}%20%40FreeCodeCamp%20#{name}&url=http%3A%2F%2Ffreecodecamp.com/challenges/#{dashedName}&hashtags=LearnToCode, JavaScript")
|
a.btn.btn-lg.btn-block.btn-twitter(target="_blank", href="https://twitter.com/intent/tweet?text=I%20just%20#{verb}%20%40FreeCodeCamp%20#{name}&url=http%3A%2F%2Ffreecodecamp.com/challenges/#{dashedName}&hashtags=LearnToCode, JavaScript", onclick="ga('send', 'event', 'twitter', 'share', 'challenge completion share');")
|
||||||
i.fa.fa-twitter  
|
i.fa.fa-twitter  
|
||||||
= phrase
|
= phrase
|
||||||
else
|
else
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
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','//www.google-analytics.com/analytics.js','ga');
|
||||||
|
ga('create', 'UA-55446531-1', 'auto');
|
||||||
|
ga('require', 'displayfeatures');
|
||||||
|
ga('send', 'pageview');
|
||||||
script(src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js")
|
script(src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js")
|
||||||
script.
|
script.
|
||||||
window.jQuery || document.write('<script src="/bower_components/jquery/dist/jquery.min.js"><\/script>');
|
window.jQuery || document.write('<script src="/bower_components/jquery/dist/jquery.min.js"><\/script>');
|
||||||
@ -29,11 +37,3 @@ script(src=rev('/js', 'main.js'))
|
|||||||
script(src="/bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js")
|
script(src="/bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js")
|
||||||
script(src="/bower_components/ramda/dist/ramda.min.js")
|
script(src="/bower_components/ramda/dist/ramda.min.js")
|
||||||
script(src='/bower_components/lightbox2/dist/js/lightbox.min.js')
|
script(src='/bower_components/lightbox2/dist/js/lightbox.min.js')
|
||||||
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','//www.google-analytics.com/analytics.js','ga');
|
|
||||||
ga('create', 'UA-55446531-1', 'auto');
|
|
||||||
ga('require', 'displayfeatures');
|
|
||||||
ga('send', 'pageview');
|
|
||||||
|
Reference in New Issue
Block a user