mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 10:01:40 -05:00
working on google analytics
This commit is contained in:
parent
b09b475283
commit
bef1ab8e0b
2 changed files with 9 additions and 4 deletions
|
@ -1,4 +1,5 @@
|
|||
analyticsInit = function() {
|
||||
|
||||
// Mixpanel
|
||||
if (mixpanelId=getSetting("mixpanelId")){
|
||||
(function (c, a) {
|
||||
|
@ -57,21 +58,23 @@ analyticsInit = function() {
|
|||
}
|
||||
|
||||
// Google Analytics
|
||||
if ((googleAnalyticsId = getSetting("googleAnalyticsId"))){
|
||||
if (googleAnalyticsId = getSetting("googleAnalyticsId")){
|
||||
|
||||
window._gaq = window._gaq || [];
|
||||
_gaq.push(['_setAccount', googleAnalyticsId]);
|
||||
window._gaq.push(['_setAccount', googleAnalyticsId]);
|
||||
|
||||
(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);
|
||||
})();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
analyticsRequest = function() {
|
||||
|
||||
|
||||
// Google Analytics
|
||||
if (googleAnalyticsId = getSetting("googleAnalyticsId") && window._gaq){
|
||||
window._gaq.push(['_trackPageview', window.location.pathname]);
|
||||
|
|
|
@ -16,6 +16,7 @@ Session.set('settingsLoaded', false);
|
|||
Meteor.subscribe('settings', function(){
|
||||
// runs once after settings have loaded
|
||||
Session.set('settingsLoaded',true);
|
||||
analyticsInit();
|
||||
});
|
||||
|
||||
// Categories
|
||||
|
@ -32,4 +33,5 @@ if(Meteor.user() != null)
|
|||
|
||||
STATUS_PENDING=1;
|
||||
STATUS_APPROVED=2;
|
||||
STATUS_REJECTED=3;
|
||||
STATUS_REJECTED=3;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue