diff --git a/client/main.js b/client/main.js index af32484411..914e9376d4 100644 --- a/client/main.js +++ b/client/main.js @@ -2,6 +2,8 @@ var main = window.main || {}; main.mapShareKey = 'map-shares'; +main.ga = window.ga || function() {}; + var lastCompleted = typeof lastCompleted !== 'undefined' ? lastCompleted : ''; @@ -451,6 +453,7 @@ $(document).ready(function() { '&redirect_uri=http%3A%2F%2Ffreecodecamp%2Ecom%2Fmap'; setMapShare(challengeBlockName); + main.ga('send', 'event', 'FB_LINK', 'SHARE', 'Facebook map share'); window.location.href = link; }); }); diff --git a/server/views/coursewares/showBonfire.jade b/server/views/coursewares/showBonfire.jade index e64424e1ac..1768bd4274 100644 --- a/server/views/coursewares/showBonfire.jade +++ b/server/views/coursewares/showBonfire.jade @@ -106,7 +106,7 @@ block content if (user) #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) - 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   = phrase else diff --git a/server/views/partials/scripts.jade b/server/views/partials/scripts.jade index 17c2d178bd..c88702daea 100644 --- a/server/views/partials/scripts.jade +++ b/server/views/partials/scripts.jade @@ -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. window.jQuery || document.write('