Google analytics tracking
1. Create a new data stream in Google analytics
Steps:
- Go to Admin → Data Collection and Modification → Data Streams
- Click Add stream → Web
- Enter your website URL and stream name
- Click Create stream
2. Get the Google analytics measurement ID
Steps:
- In the data stream settings, click on your newly created data stream
- Copy the Measurement ID (starts with G-XXXXXXXXXX)
3. Create custom events in Google analytics
Do this before you set up the triggers in GTM.
Steps:
- Go to Admin → Data Display → Events
- Click Create event
- Name the event SurfaceFormSubmitEvent (this should match the event name you'll use in GTM)
- Scroll down and click View more options
- Under Matching conditions, remove the
page_locationparameter - Click Save
4. Create custom event triggers in GTM
Create one trigger per Surface form event you want to track.
Steps:
- In GTM, go to Triggers
- Click New → Trigger Configuration
- Select Custom Event
- Enter the event name as SurfaceFormSubmitEvent
- Click Save
5. Create Google analytics GA4 event tags
Steps:
- In GTM, go to Tags
- Click New → Tag Configuration
- Select Google Analytics: GA4 Event
- Enter your Measurement ID (from Step 2)
- Set the Event Name
- Under Triggering, select the trigger you created in Step 4
- Click Save
6. Submit and publish changes
- Click Submit in GTM
- Add a version name and description
- Click Publish
Testing using Google tag assistant
- Install the Google Tag Assistant extension in your browser
- Go to tagassistant.google.com
- Click Add domain and enter your website URL > Click Connect - this will open your website in a new tab
- Fill out and submit a Surface Form to see the events being tracked