Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is sharing Google Analytics tracking id safe?

I currently creating a cross platform desktop application using Electron. I wish to add analytics to view user metrics. When I try to find for existing packages that provides metrics info, I found electron-ga.

The package uses GA to track user metrics and to set it up I need to include GA tracking id in my app. My question is, if I include the tracking id in an electron app and distribute my app, everyone can look at the tracking id and steal it right?

I would like to know if using this method is right?

Thank you.

like image 801
user2672399 Avatar asked Mar 22 '18 01:03

user2672399


2 Answers

It will be anyway publicly available (e.g. you can find the ga ID through the source code of any site that uses Google Analytics).

It can get very bad if someone wants to harm you, as he can just plug your ga ID in any of his sites unless you are prepared and protected.

What you can do to be sure that even if someone has your ga ID, he can't make use of it, is the folowing. Go to your Google Analytics profile and create a custom filter. Choose "Hostname" for the filter field and fill the filter pattern with your site (e.g. mysite.com). Don't forget to use the "\" before of any ".".

This way, only this specific address will be able to make use of your ga ID.

like image 135
Nats Avatar answered Sep 29 '22 08:09

Nats


That is ok. You could see many people push the ga id at website or app. It is necessary. If you don't add tracking id to ga code. Then you cannot track user.

like image 24
Rukeith Avatar answered Sep 29 '22 08:09

Rukeith