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:

Use Case
Description

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

To achieve these advanced tracking configurations, you will need to follow the following steps for each GA4 property:

  1. Create a GA4 Proxy Destination instance

  2. Disable the built-in page_viewevent

  3. Set up one or more custom page_viewevents

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

Navigate 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_viewevents

Custom page_viewevents depend on whether you manage event tracking in Google Tag Manager or in Freshpaint directly.

Instructions for Google Tag Manager

  1. 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".

  2. Create your custom page_viewtag. Navigate to "Tags", click "New", and select the "Freshpaint" template under "Custom".

    1. For tag type, select "Google Analytics 4 (Proxy)"

    2. 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_viewevent for each.

    3. For "Freshpaint Event Name", enter page_view.

    4. Use a "Page View"-type trigger for this tag to trigger on the pages you want to measure with this GA4 property.

  1. Don't forget to "Publish" your changes!

Instructions for Freshpaint Event Library

  1. Create a new event definition

    1. Navigate to the Event Library and click "+ Create Event".

    2. Give the event a meaningful name, such as "mywebsite.com/blog GA4 custom page_view"

    3. 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 *.

    4. (Optional) Add any additional filters. For example if this GA4 property needs to measure traffic to only one domain, add a filter on "Domain".

    5. Click "Create Event".

    6. 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.

  2. Create a transformation to rename this event to page_view

    1. In Freshpaint, navigate to Transformations

    2. Click "+ Create New"

    3. Click "Modify Data"

    4. Choose your event definition's name from step 1b.

    5. Choose "Google Analytics 4 (Proxy)" for the destination.

    6. Click "Save & Add Transformation".

    7. On the next screen, choose the "Rename Event" transformation and enter page_view for the event name. Click "Save".

Last updated

Was this helpful?