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. 


We do this also, but we sync the files within the app for offline usage. Makes no difference.

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.

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

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

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!

After moving it to my server and attempting to debug on the remote device produces the following without displaying traffic in GA.


tools.js:100 Project - File loaded.

tools.js:100 REPORTING - Added GOOGLE ANALYTICS

tools.js:100 Tracker is active

tools.js:100 Tracker - loaded.

tools.js:100 CLOUDTRACKER (scan #1) - NEGATIVE

tools.js:100 CLOUDTRACKER (scan #2) - NEGATIVE

tools.js:100 CLOUDTRACKER (scan #3) - NEGATIVE

tools.js:100 CLOUDTRACKER (scan #4) - NEGATIVE

tools.js:100 CLOUDTRACKER (scan #5) - NEGATIVE

tools.js:100 CLOUDTRACKER (scan #6 - POSITIVE FeatureAuthor-Johnson

tools.js:100 TARGET recognized FeatureAuthor-Johnson

tools.js:100 Tracker - stopped (cloud)

tools.js:100 Augmentation JSON - Loading starts

tools.js:100 Augmentation JSON - Loaded

tools.js:100 Augmentations - loaded overall 100

tools.js:100 Augmentations - Successfully created

tools.js:100 TARGET lost FeatureAuthor-Johnson

tools.js:100 Tracker - stopped (cloud)

tools.js:100 TARGET recognized FeatureAuthor-Johnson 



I receive the following error when I try to debug the same project via the Wikitude app.

Failed to load resource: the server responded with a status of 404 (Not Found) 


  <script src="https://www.wikitude.com/libs/architect.js"></script>


It still generates GA traffic. 


So I should go into my project and go to Project > Download offline project and host it on my servers? I notice additional options under the Project menu for publishing to Wikitude app and Hosting but it tells me it requires an SDK subscription but I believe this was part of my subscription. Could you confirm these additional features require a different license?

Hi there!

Please try hosting the project on your own server (http/s-protocol) and add some debug information around the GA calls in the tools.js section. Maybe the GA calls were called but caused an issue due to wrong hosting set up. Also, check whether running the same experience as a bundled application within your app works (file-protocol).


Br,

Andreas

Hi Andreas, I'm still experiencing problems with GA in general. I can't seem to get analytics to work in my application despite things working fine with my project in the Wilitude app. Do you have any additional thoughts in debugging the issue for the items I mentioned above? Logan

Hi there!


I hope you made good progress during your investigation. In terms of userId passing: Tracking is implemented in a really simple way. Passing custom information from your native environment is not supported. You may customize the GA implementation to define session params etc. I recommend sticking to the vanilla template to avoid repetitive modifications on upcoming template updates.


Best regards,

Andreas

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

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.

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? 

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

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? 

Login or Signup to post a comment