mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 10:01:40 -05:00
updated to new google analytics snippet and syntax
This commit is contained in:
parent
ad363ea964
commit
60f3876f9e
1 changed files with 9 additions and 9 deletions
|
@ -60,14 +60,12 @@ analyticsInit = function() {
|
|||
// Google Analytics
|
||||
if (googleAnalyticsId = getSetting("googleAnalyticsId")){
|
||||
|
||||
window._gaq = window._gaq || [];
|
||||
window._gaq.push(['_setAccount', googleAnalyticsId]);
|
||||
(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');
|
||||
|
||||
(function() {
|
||||
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
||||
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
||||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
||||
})();
|
||||
window.ga('create', googleAnalyticsId);
|
||||
|
||||
}
|
||||
|
||||
|
@ -76,8 +74,10 @@ analyticsInit = function() {
|
|||
analyticsRequest = function() {
|
||||
|
||||
// Google Analytics
|
||||
if (googleAnalyticsId = getSetting("googleAnalyticsId") && window._gaq){
|
||||
window._gaq.push(['_trackPageview', window.location.pathname]);
|
||||
if (typeof window.ga !== 'undefined'){
|
||||
ga('send', 'pageview', {
|
||||
'page': window.location.pathname,
|
||||
});
|
||||
}
|
||||
|
||||
// Mixpanel
|
||||
|
|
Loading…
Add table
Reference in a new issue