Configuring and installing GA4 via GTM for a WordPress site

  1. Go to https://analytics.google.com/analytics/web/
  2. Use the Google Analytics property you were granted access to. If you have to create a new account or property, it’s important that you add the client’s Google account as the owner/admin of the account or property, so they have access to the account if they decide to change agencies.
  3. Go to the Admin link in the lower-left corner of the page. Be sure you’re in the proper account.
  4. Create a new property if you don’t see an existing property with GA4 in the name under the Create Property button in the middle.
  5. If you’re creating a new property, name it “Business Name – GA4”.
  6. Select the time zone of the client, then click Next.
  7. Select an Industry category and business size (this doesn’t matter, so just get it close).
  8. Select Get baseline reports as the business objective, then click Create.
  9. Go to the Data Streams admin menu, then add a data stream (Add stream > Web) if one doesn’t already exist.
  10. Enter the website URL in the designated field, choose https:// and enter the www or don’t, depending on how the site is set up. You can visit the site and look in the address bar to find out whether the site uses www or not, then click Create Stream.
  11. If a stream already exists, you can select it from the list.
  12. Copy and paste the measurement ID to have it handy for the next steps. The measurement ID looks like this G-1A2B34C5DE. You may now close the Web stream details page.
  13. Next, under the Admin section, open Data Settings > Data Retention. Change Event data retention from 2 to 14 months, then click Save.
  14. Next, under the Admin section, open Reporting Identity and click Show All.
  15. Select Device-based, and click Save. You’ll click Confirm to stop using Blended Identity.

Next, go to Google Tag Manager to install the base GA4 code.

  1. Go to Google Tag Manager at https://tagmanager.google.com/
  2. Use the Google Tag Manager account and container you were granted access to. If you have to create a new account or container, it’s important that you add the client’s Google account as the owner/admin of the account or container so they have access to the account if they decide to change agencies. The client must accept the invite after you add them to gain access to their GTM account.
  3. Select the property to go into that website’s GTM account.
  4. Go to Tags and review what’s there currently.
  5. Click New in the upper right corner to create a new tag.
  6. Name the tag, GA4 Base Tag.
  7. Select Google Analytics: GA4 Configuration from the list of prefilled options for the tag.
  8. Enter the Measurement ID from earlier in the indicated field, then click Save.
  9. You’ll be prompted to Add a Trigger. Choose that option and next, we’ll tell Google Tag Manager when to fire the GA4 base tag.
  10. Select the All Pages option from the Choose a trigger list. This means the GA4 base tag will fire on all pages when the chosen GTM code is installed on your site. Click the Save button.
  11. Click Submit to Publish your changes. Add notes, including your first name. Your note can say, installed the GA4 base tag. Then you’ll click Publish.

Next, add two events in GTM.

Add an event to track phone number clicks

  1. First, go to New Tag.
  2. For the tag’s name, use the following naming convention. “GA4 [description of the event]”. We’ll be setting up tracking for Mobile Clicks to Call, so we’ll name the tag “GA4 Mobile Click to Call”
  3. Under Tag, choose Google Analytics: GA4 Event.
  4. Choose your GA4 Base Tag we created earlier from the Tag Configuration.
  5. In the Event Name, enter phone_number_clicks.
  6. Expand Event Parameters, Add Row. In Parameter Name, enter link_url, and in the Value field, enter {{Click URL}} — Click URL should auto-populate since it’s a variable. We know it’s a variable, because of the double brackets around it.
  7. Click Save, and you’ll be prompted to Add a Trigger.
  8. There might already be a Phone Clicks trigger. If so, it will say Click URL contains tel: If it’s already there, select it. If not, go to the next step to add it.
  9. Click the + button to Add a new trigger. In the Trigger name, enter Mobile Phone Clicks.
  10. From the Trigger type, select Just Links. Change from All Link Clicks to Some Link Clicks.
  11. Change the first dropdown under Some Link Clicks to Click URL, then select contains, and in the box, enter tel:
  12. Save the trigger, and we’re finished, except for the publish step, which we’ll do after we add the form submission tracking event.
  13. If you wish to add email clicks as well, you’d repeat steps 1-12, except the Click URL would be contains mailto:

Add an event to track Contact Form submissions

  1. First, go to New Tag.
  2. For the tag’s name, use the following naming convention. “GA4 [description of the event]”. We’ll be setting up tracking for Contact Form Submissions, so we’ll name the tag “GA4 Contact Form Submissions”
  3. Under Tag, choose Google Analytics: GA4 Event.
  4. Choose your GA4 Base Tag we created earlier from the Tag Configuration.
  5. In Event Name, enter generate_lead (a Google-recommended event, so don’t change the name).
  6. Expand Event Parameters, Add Row. In Parameter Name, enter ____, and in the Value field, enter___ — ___ should auto-populate since it’s a variable. We know it’s a variable because of the double brackets around it.
  7. Click Save, and you’ll be prompted to Add a Trigger.
  8. … Continue instructions

Screenshot for Event

Google Tag Manager 2023-07-24 at 4.25.13 PM

Screenshot for trigger

Google Tag Manager 2023-07-24 at 4.23.11 PM

Leave a Comment