Set up Analytics tracking

30/11/2019

In this article:

Basic instructions

  1. If you have not already done so, create a property in Google Analytics. Create one Analytics property for each website you want to track. Creating a property generates a tracking ID, which you'll use in your gtag.js tracking code snippet.
  2. Find your tracking ID, as described below. You'll use this tracking ID in the tracking code snippet.
  3. Copy and paste the gtag.js tracking code snippet to each web page you want to track. Add the tracking code snippet right after the opening  tag on each page.

Find your tracking ID

To find the tracking ID:

  1. Sign in to your Analytics account.
  2. Click Admin.
  3. Select an account from the menu in the ACCOUNT column.
  4. Select a property from the menu in the PROPERTY column.
  5. Under PROPERTY, click Tracking Info > Tracking Code. Your tracking ID is displayed at the top of the page.

Tracking code snippet

Paste the following snippet right after the tag on each page of your site. Replace GA_TRACKING_ID with your own Google Analytics tracking ID:



Verify that the tracking code is working

To verify that the tracking code is working, visit your website and check to see that your visit is being registered in the Real-Time reports.

gtag.js Developer Guide

* Nguồn: Google Analytics