Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No analytics from Electron app #90

Closed
FantasticFiasco opened this issue Oct 8, 2017 · 9 comments
Closed

No analytics from Electron app #90

FantasticFiasco opened this issue Oct 8, 2017 · 9 comments

Comments

@FantasticFiasco
Copy link

I don't seem to get analytics from an Electron application, and am guessing it has to be a configuration issue from my part.

You can see my code here (I am just basically wrapping the calls to Visitor here).

Is there some kind of configuration I've possibly done wrong on Google Analytics? From the point of universal-analytics, I've turned on debug and it seems that events are transmitted due to the following logs:

[universal-analytics] Finished sending tracking calls
[universal-analytics] Finished sending tracking calls
[universal-analytics] Finished sending tracking calls
...

Are there any usual suspects I can verify? Both on the transmitting end and on Google Analytics?

Thanks for the help.

@Arti3DPlayer
Copy link

Same with nw.js

"[universal-analytics] Enqueued screenview ({"cd":"Main Screen","an":"","v":"1","tid":"UA-XXXXXX","cid":"cbb37c18-67b8-4a10-9b42-b7d34e6736ab","t":"screenview"})",```

analytics not appear in realtime:(

@FantasticFiasco
Copy link
Author

I think my issue is that I am posting strings in the event tracking value (according to the TypeScript definitions this is valid, but Google Analytics differently) . I am currently correlating with https://ga-dev-tools.appspot.com/hit-builder/, which seems like an awesome tool.

If I turn on debug in universal-analytics, I can re-post the same event using the tool, and it tells me what I am doing wrong.

@FantasticFiasco
Copy link
Author

When it comes to screen views, please read this: http://support.visiolink.com/hc/en-us/articles/208794665-Screen-Views-in-Google-Analytics

I will post page views instead of screen views in my Electron app, because page views seems to be a first class citizen, while screen views aren't.

@Arti3DPlayer
Copy link

@FantasticFiasco I launched my app about 50 times, send events etc. But in dashboard I see only my 2 sessions, 0 events and 5 screen views

@FantasticFiasco
Copy link
Author

You can see my code here. It works as I expect it to work, i.e. I can see realtime content hits and events.

@XanderLuciano
Copy link
Contributor

@FantasticFiasco Your link is now broken. Any chance you could share a quick snippet of your code?

@FantasticFiasco
Copy link
Author

It is too much code for a snippet, but my wrapper class is here

@XanderLuciano
Copy link
Contributor

@FantasticFiasco Thanks, I'm not getting any events to show up in analytics currently. Screen views w/uid's is working just fine (multiple instances only appear as 1 user). Hoping I can sort out why my events aren't appearing by looking though your code.

@XanderLuciano
Copy link
Contributor

XanderLuciano commented Jun 5, 2018

Turns out filtering by Application? == Yes in Google Analytics filtered out the events also.. so I just changed my filter to filter out by Application ID instead, which appears to give to correct results finally.

Edit: Also needed to add the App Id to the Visitor object like so

visitor.set('aid', 'com.company.product');

Edit2: Looks like there is an actual GA property called Data Source which you can set as well.

Edit 3: Looks like setting Data Source as app and filtering by Application? Yes/No is the proper method!

visitor.set('ds', 'app');

This adds the ds=app to each GA hit, and lets you properly filter your views in Google Analytics.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants