Start a new topic

Google Analytics set up

Should my GA property be defined as a website or mobile app? I've tried it both ways but I'm not seeing my Cordova based app reporting into GA. 


Note that the tracking happens inside the JS context of the experience and will only work with active Internet (permission).


You may open tools.js, search for `Logger` and set `enabled` attribute to 'true' so that you can remote debug the webView. Additionally add some Logger.info lines to the `createGoogleAnalyticsSignalListener` function.

Hope that helps,
Andreas


1 person likes this
I'm referring to the GA setup for the tracking code inside of my AR content. There is the option to add it from insid my AR project in the studio but it doesn't appear to populate GA.

Hi again,

Just create a default website GA account and enter the GA-key. You should see events arriving in real time. I just tested using a temporary test account.

Note that the tracked events should give you basic information about popular targets and augmentations. You will e.g. see which augmentations are loaded. Values of event/action/label may be hard to read, but I attached the convention.


Hope this helps

event_info.png
(23.6 KB)

Are you using it as an offline package? That is how my project is structured and I'm not seeing it either. 

Hi Andreas,


But I can assume that it should work just fine as an offline package when connected to the Internet? 


Thanks,

Logan

Yes,
we added the line
`ga('set','checkProtocolTask',null);`
as documented in the official GA docs for that reason.


Please also check tracking during the preview of your experience via the Wikitude application.


Best regards,


OK, I have it working inside the Wikitude application so I'll try it in my app now. On a side note, is it possible to pass in a userid value into the tracking? 

Unfortunately, there is yet no way to fire custom events.


You may adjust the tools.js manually and add define custom variables though.
However, I recommend sticking to the vanilla template as are anyhow able to trace a user's app behavior by session.

Consider developing the experience by your own (compare SDK Sample Application) in case you need a custom tracking and interactive components.


Best regards,
Andreas

I tried the Logger option and received the following.


Project - File loaded.

tools.js:100 REPORTING - Added GOOGLE ANALYTICS

tools.js:100 Tracker is active

tools.js:100 Tracker - loaded.

tools.js:100 TARGET recognized FeatureAuthor-Johnson

tools.js:100 Augmentation JSON - Loading starts

tools.js:100 Augmentation JSON - Bundled in metadata (for offline use)

tools.js:100 Augmentations - loaded overall 100

tools.js:100 Augmentations - Successfully created

tools.js:100 TARGET lost FeatureAuthor-Johnson


However, I still don't see tracking in GA.  Is there any additional debugging you could recommend? 

Does this comment is in tools.js have anything to do with it? 


 

Note that the created ImageTracker has enabled flag set to FALSE. Set enabled to true (or call arTracker.start() ) to activate it.

Also, when debugging the webview, I noticed there was no network traffic when inside the plugin. 

Hi Logan Thomison, i'm also trying to implement Google Analytics in my Wikitude experiences but it's not working? Could you share your method please? We ar eon the Cordova version too.

Thanks a lot in advance!

Is the package local? If so, move it to a server with a public URL and see if it starts generating events. 

Yes it does generate pageviews and events, but not when it's loaded from our app...

I just opted to run it from the server. It solved my problem and gave us the ability to update things without publishing the app again. Probably best to just use the cloud directly if it is possible. I haven't come across any documentation that outlines the approach.

Login or Signup to post a comment