简体   繁体   中英

How Google analytics can track e-commerce visitors behavior

I am sorry if my question seems to be weird but I can't find any information on the Web..

The question is simple: how Google analytics can be able to track ANY e-commerce website's data?

Websites are different and each one is coded differently so how Google Javascript tag could detect special events like transactions and adding to cart?

Note : I am not talking about simple data like visit duration or seen pages or the URL etc. I am talking about spacial information like:

  • Visitors commands
  • Visitors carts
  • Visitors carts amount
  • Etc

Basically it works like this. There is a standard piece of javascript for google analytics that is placed on ever page typically done via an include file of some sort that causes it to be included on ever page of the website.

That basically gets you all the standard analytics (visits, page views, etc).

Then if you want ecommerce tracking (like value of orders placed, products ordered, etc) you place a second javascript file on your thank you page and that piece of javascript has parameters for order value, and products on the order (qty and price). You can see more details of the many fields that can be passed about the order here: https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce

In summary: Outside of the standard analytics that it can collect with the sitewide javascript file, Google Analytics only knows what you tell it. So if you want cart or order tracking, you need to include a special javascript file for that and pass it the information you want to see in Google Analytics.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM