Google Analytics 4 Proxy Advanced Tracking Configurations
Considerations when using more complex tracking configurations for Google Analytics
By default, built in page_view
, scroll
, and user_engagement
events will be sent to all configured measurement IDs in a given environment, for every page where the Freshpaint Autotrack snippet is loaded. This default behavior may not suit your use case. Freshpaint supports a number of alternate tracking configurations to ensure accurate measurement.
Here are some examples of advanced tracking configurations:
Property per-domain
Track each domain in its own GA4 property. For example:
GA4 property A measures only the traffic on mywebsite.com
GA4 property B measures only the traffic on yourwebsite.com
Property per-subdomain
Track each subdomain in its own GA4 property. For example:
GA4 property A measures only the traffic on www.mywebsite.com
GA4 property B measures only the traffic on app.mywebsite.com
Property per-page or per URL path prefix
Divide the tracking for a domain or subdomain into multiple GA4 properties based on the page URL path or any other condition. For example:
GA4 property A measures only the traffic on mywebsite.com/blog/...
GA4 property B measures only the traffic on mywebsite.com/careers/...
Don't track certain pages
Prevent specified pages from tracking to GA4. For example, if GA4 property measures traffic on mywebsite.com, but mywebsite.com/login/... is a sensitive section of the site which should not be tracked to GA4.
Caveats
If you are using GA4 to measure a Single Page App (SPA), the GA4 property must measure all paths within the SPA. Measuring only certain paths within a SPA is not supported by Freshpaint and may result in misattributed traffic and significantly inaccurate event/session/user counts.
How To Set Up Custom page_view
Events
page_view
EventsTo achieve these advanced tracking configurations, you will need to follow the following steps for each GA4 property:
Create a GA4 Proxy Destination instance
Disable the built-in
page_view
eventSet up one or more custom
page_view
events
Incorrect configuration may result in misattributed traffic and significantly inaccurate event/session/user counts, so please be sure to follow the instructions carefully! Feel free to reach out to support@freshpaint.io for assistance.
1. Create a GA4 Proxy Destination Instance
Follow the instructions at Google Analytics 4 Proxy Quick Start Guide to create your GA4 proxy destination. If you already have a destination instance for this measurement ID, you can skip to the next step.
2. Disable the built-in page_view
event
page_view
eventNavigate to the apps page and click Manage for the GA4 destination.
Click Configure in the Base Configuration row.
Uncheck Send Page View Event and click "Save"
3. Set up one or more custom page_view
events
page_view
eventsCustom page_view
events depend on whether you manage event tracking in Google Tag Manager or in Freshpaint directly.
Instructions for Google Tag Manager
Import the Freshpaint tag template in Google Tag Manager. If you already have the Freshpaint tag template, you can skip this step. Otherwise, navigate to Templates, click "Search Gallery", and search for Freshpaint. Then, click "Add To Workspace".
Create your custom
page_view
tag. Navigate to "Tags", click "New", and select the "Freshpaint" template under "Custom".For tag type, select "Google Analytics 4 (Proxy)"
Enter the measurement ID for your GA4 property. Do not enter more than one measurement ID; instead, you'll need to create a separate custom
page_view
event for each.For "Freshpaint Event Name", enter
page_view
.Use a "Page View"-type trigger for this tag to trigger on the pages you want to measure with this GA4 property.
Don't forget to "Publish" your changes!
Instructions for Freshpaint Event Library
Create a new event definition
Navigate to the Event Library and click "+ Create Event".
Give the event a meaningful name, such as "mywebsite.com/blog GA4 custom page_view"
For Library, choose "Web". For "Event Type", choose "Pageview". For URL Path, enter the path you would like to measure with this GA4 Property. To measure all pages, enter
*
.(Optional) Add any additional filters. For example if this GA4 property needs to measure traffic to only one domain, add a filter on "Domain".
Click "Create Event".
Under "Event Destinations" turn on the destination for GA4 property you want to use to measure these pages. Do not turn on more than one destination; instead, you'll need to create a separate event definition for each destination.
Create a transformation to rename this event to
page_view
In Freshpaint, navigate to Transformations
Click "+ Create New"
Click "Modify Data"
Choose your event definition's name from step 1b.
Choose "Google Analytics 4 (Proxy)" for the destination.
Click "Save & Add Transformation".
On the next screen, choose the "Rename Event" transformation and enter
page_view
for the event name. Click "Save".
Last updated
Was this helpful?