The first step to tracking Google Analytics in your website is to make sure that you have a Google Analytics account created. If you don’t yet have that done, follow the steps here to create a Google Analytics 4 Property: https://support.google.com/analytics/answer/9304153?hl=en
Once your property is created, you have two options for linking it to your website to begin collecting data.
1. ValiceWP Settings
If you have the ValiceWP plugin installed, then you have access to a field to add your Analytics ID to begin collecting data.
Retrieve your Google Analytics ID
- Log into Google Analytics and select your Property
- Navigate to “Admin” (gear icon in lower left corner) > “Data Streams”
- Select your Website Data Stream and then copy the Measurement ID field (this will start with a “G” and be followed by several letters
Add the Measurement ID to ValiceWP
- Login to your WordPress Website
- Navigate to “ValiceWP” from the dashboard menu
- Paste the Measurement ID into the “Google Analytics ID” field
- Click Save Changes
You should be able to visit your website now and verify that it is tracking real time data. If you need assistance with this setup just reach out and schedule a remote hands session.
2. Insert into your Theme’s header.php File
Retrieve your Google Analytics Site Tag Script
- Log into Google Analytics and select your Property
- Navigate to “Admin” (gear icon in lower left corner) > “Data Streams”
- Click on “View tag instructions” toward the bottom of the page and select “install manually” (last link)
- Copy this script and insert it in your WordPress theme’s header.php file between the opening <head> and closing </head> tag somewhere.
If you need assistance with this setup just reach out and schedule a remote hands session.