0

I want to build own analytic platform base on google analytic (GA).

So I had a quick investigation on GA.

But I have some misunderstand below:

  1. In the website and web apps field, google analytic give three options: gtag.js, analytic.js, AMP HTML. But I don't know what will I choose whichever. or could you help me point out the case that we will use for each option?

  2. I tried to follow gtag.js, debug and realize that google analytic send a gif request to post data to google analytic server. I think they use this way to avoid cross-domain Ajax. But the question is how they send data to google server by Android/IOS sdk? They still used gif request or normal restful api.

If anyone know or have idea please help and sharing to me.

Thanks in advance

Jame

Jame H
  • 1,324
  • 4
  • 15
  • 26

1 Answers1

0

gtag.js (global tag) is the current version of Google tracking code - "global" because it aims to provide a unified tracking code for Analytics, Adwords, and other Google products.

With the release of the gtag libary analytics.js is now the legacy version of the Google Analytics Javascript tracker, so currently most available information refers to that. However if you are getting started with Analytics you probably should use the current version.

AMP are accelerated mobile pages, a special format with reduced markup and scripting options that is cached on and delivered from Google servers (you relinquish control over your pages in favour of faster delivery, basically). If you have to ask what this is then you are not using it, and do not need this type of tracking code.

If you use Google Analytics in a mobile website you'd use the Javascript tracker and that will indeed return a gif.

If you want to track a native App you would, these days, use Google Analytics for Firebase which comes with it's own SDK. You would implement Firebase in your App and then connect the Firebase project to a mobile property in GA.

Eike Pierstorff
  • 31,996
  • 4
  • 43
  • 62
  • @Erike Pierstorff: It means I should base analytic.js to build my anlytic platform. And GA's mobile SDK also send a gif request to push data to server. Is it right? – Jame H Oct 27 '17 at 06:58
  • Most experts I can find recommend to continue with analytics.js because gtag is still in beta. Mobile tracking is now done via Firebase, which does not use pixel tracking. – Eike Pierstorff Nov 02 '17 at 09:47
  • @ Eike Pierstorff : Could you give more detail about mobile implement? They build a http api (get,post,...) or other technique. I have very appreciate if you share me some document – Jame H Nov 02 '17 at 09:51