There are tracking tags like Google Analytics, but I don't know how they work.

Asked 4 months ago, Updated 4 months ago, 11 views

https://developers.google.com/analytics/devguides/collection/analyticsjs/advanced?hl=ja

I have a vague understanding that the script tag you embed is igniting a script that collects logs from google-analytics.com/analytics.js, but I don't understand it at all and I don't know how it works.

Therefore, I have the following questions.

·How does Google collect the user's IP address and store the data in the analysis.js process?(I don't understand this the best, I always wonder how they extract all kinds of data.)

·Is it easy for users not to get caught in cross origin problems in many and unspecified fields?

·Installing a js file like google-analytics.com/analytics.js on the server and accessing it based on the script file installed by the user. Is the following process used to do so?

(window, document, 'script', '//www.google-analytics.com/analytics.js','ga');

There is a function called window.document.write, but is window.document.script a function that Google created independently?

Thank you for your cooperation.

javascript google-analytics-api

2022-09-30 11:36

2 Answers

Let's google it.Read the Google commentary.
It's against the rules to just post links, but it's not a one-word story.

https://developers.google.com/analytics/resources/concepts/gaConceptsTrackingOverview?hl=ja

The point is to collect the data and then push the tag of the URL containing the information into the DOM to load the 1-pixel GIF.There is no problem with origin because it is an image.


2022-09-30 11:36

Previously, there was a Google Analytics commentary on @IT (link below)
I think it will be helpful.

Introduction to Google Analytics: An overview of Google Analytics that even the first IT administrator would like to know


2022-09-30 11:36

If you have any answers or tips


© 2023 OneMinuteCode. All rights reserved.