Search the Community
Showing results for tags 'meow'.
-
Hola, So I tried integrating GA into my latest game for some stats tracking based on official google docs. I got the page views and events working but my metrics show up as "not set" for some reason. Here's my set up: Here's the code I set up: TrackPageView: function(inPage, inTitle) { if(!this._IsInitted || !this._IsEnabled) { return; } ga('send', 'pageview', inPage); if(typeof inTitle !== 'undefined') { ga('set', 'title', inTitle); } console.log("GA PageView: [" + inPage + "][" + inTitle + "]"); }, TrackEvent: function(inCategory, inAction, inLabel) { if(!this._IsInitted || !this._IsEnabled) { return; } ga('send', 'event', inCategory, inAction, inLabel); console.log("GA Event: [" + inCategory + "][" + inAction + "][" + inLabel + "]"); }, //https://developers.google.com/analytics/devguides/collection/analyticsjs/custom-dims-mets TrackEventVar(inIndex, inValue) { if(!this._IsInitted || !this._IsEnabled) { return; } var i = 'metric' + inIndex; //ga('send', 'event', inCategory, inAction, { // i: inValue //}); ga('set', i, inValue ); console.log("GA EventVar: [" + i + " = " + inValue + "]"); }, And here's where I use it: sGA.TrackEventVar(1, Math.floor(playTime)); sGA.TrackEventVar(2, Math.floor(sStats.FollowerSpawnedTotal)); sGA.TrackEventVar(7, Math.floor(sStats.BlueFlowersCollected)); sGA.TrackEventVar(4, Math.floor(sStats.FollowersDied)); sGA.TrackEventVar(3, Math.floor(sStats.FlowersCollected)); sGA.TrackEventVar(5, Math.floor(sStats.BunniesKilled)); sGA.TrackEventVar(6, Math.floor(sStats.SnakesKilled)); sGA.TrackEvent("Game End", "GameEnd", "Game WON"); sGA.TrackPageView("/gather-game-end-win", "GATHER Game WON"); Both Event and PageViews report properly, and the metrics under "Audience -> Custom -> User Defined" show up as "(not set)" Any idea?
- 3 replies
-
- fluffy kittens
- meow
-
(and 4 more)
Tagged with: