In Google Analytics, a tracking code (JavaScript Code gtag.js) tracks the activity of a website user by collecting data and sending it to the analytics module. The code is generated automatically and has to be installed on each page of the website you want to track.
Sign up for Google Analytics and configure it for your site, or just log in if you’ve already completed that step.
- Click Admin
- Select your site’s account from the menu in the ACCOUNT column
- Select a property from the menu in the PROPERTY column
- Under PROPERTY, click Tracking Info > Tracking Code. Your tracking ID is displayed at the top of the page
- Copy that Tracking ID
- Sign in to your Website Pro site’s WordPress admin panel
- Navigate to Settings > General and scroll to the bottom
- Paste that Tracking ID into the Custom Google Analytics Tracking ID and click Save Changes
- To ensure accurate tracking and analysis, please verify that the Google Analytics account is connected under the business app's settings > connections as well.
OR
You can add the tracking ID directly to the code. If you are in the WordPress dashboard, select "Divi" from the left-hand side. Any code you place here will appear in the body section of all pages of your blog. This is useful if you need to input a tracking pixel for a state counter such as Google Analytics.