Skip to main content
Skip table of contents

Google Analytics 4 (GA4) Integration

If you have an existing GA4 account and a data stream set up for data collection, you can easily measure the impact of your campaigns in Google Analytics.

If tracking is set up correctly, you can expect to see a 0 to 80% match rate between the two platforms. There will never be a 100% match due to differences between the attribution models and technical complexities.

Attribution

Due to the fundamental differences between the attribution models used by Peacock Ad Manager/tvScientific and Google Analytics 4, discrepancies in reporting are inevitable. tvScientific’s deterministic attribution model uses household identifiers to match a user’s outcome to a CTV impression. GA4 uses a data-driven attribution model that analyzes data to create conversion rate models excluding direct visits from receiving attribution credit. tvScientific reports page visits from exposed to CTV ads users to GA4, but how data is displayed in your Google Analytics account is solely based on your GA4 configuration and attribution settings. A GA4 page visit is not defined the same way the tvScientific page visit, so the session will not match.

Traffic source parameters such as source and medium are tied to the first session event within a set attribution window, meaning if GA4 already attributed the user’s first session to a different channel (e.g. paid search), then all events after will be attributed to paid search.

Consent

GA4 uses first-party cookies to capture data about web visitors. If a user doesn’t accept cookies or has JavaScript disabled, then GA4 can’t track their touchpoints. Unlike GA4, tvScientific doesn’t require cookies to track page visits and outcomes, meaning Peacock Ad Manager/tvScientific will capture more page visits than GA4.

How does the integration with GA4 work?

Peacock Ad Manager’s integration into GA4 uses the GA4 Measurement Protocol API to provide you with comprehensive cross-device performance data within your GA4 property.

  1. A user is exposed to an ad.

  2. The user then visits your website.

  3. If the website visit is credited to your Peacock Ad Manager campaign (per the attribution rules defined in your ad account), website visit data with event parameters is sent to GA4 via the GA Measurement Protocol API.

  4. GA4 interprets the data, enabling you to observe users, sessions, and events originating from your Peacock Ad Manager campaigns.

What data is sent to GA4?

We use the measurement protocol to enhance the events you've previously collected via gtag or Google Tag Manager. We augments the users' existing session by reporting the campaign details via a page view event when the event is attributed to Peacock Ad Manager. The following event parameters are included:

Key

Value

Description

campaign_medium

CTV

The method for acquiring users to your website or application

campaign_source

tvScientific

A representation of the publisher or inventory source where traffic originated.

campaign_name

tvScientific

The name used to identify a specific promotion or strategic campaign.

ad_source

tvScientific

The source network that served an advertisement.

client_id

Unique value

Analytics generated for a browser when a user visits your website.

session_id

Unique value

Timestamp of when a session began.

timestamp

Unique value

A Unix timestamp (in microseconds) for the time associated with the event.

event

page_view

Type of event.

Since we send visit data to GA4 through the Measurement Protocol API, all recorded events are based on your GA4 event and attribution settings.

Set up the integration with GA4

There are three steps to integrate Peacock Ad Manager with Google Analytics.

  • Enable GA4 in Peacock Manager

  • Install tracking pixels

  • Create a custom definition in GA4

Enable Google Analytics 4 in Peacock Ad Manager

  1. In Peacock Ad Manager, navigate to the Tracking module and click +Create Tracking Code.

  2. Select I am using Google Analytics 4 (GA4), enter your GA Measurement ID and GA4 API key. If you need help finding your measurement ID or API key, refer to the table below.

  3. Click Save.

Find your measurement ID

Generate your Measurement Protocol API secret

  1. Go to your GA4 account.

  2. In Admin, go to the Data collection and modification section and click Data Streams.

    image-20240920-180405.png
  3. Click the Web tab.

  4. Click the data stream.

  5. Locate the measurement ID as shown in the following image.

image-20240920-180006.png
  1. Go to your GA4 account.

  2. In Admin, go to the Data collection and modification section and click Data Streams.

    image-20240920-180405.png
  3. Click the Web tab.

  4. Click the data stream.

  5. Click Measurement Protocol API secrets.

    image-20240920-181846.png
  6. Click Review terms on the acknowledgement.

  7. Create a new secret.

Install tracking pixels

Install tracking pixels on your website or using a tag manager as outlined in https://nbcuadproducts.atlassian.net/wiki/spaces/PADMAN/pages/134840321 .

Create a custom definition in GA4

  1. Go to your GA4 account.

  2. In Admin, go to the Data display section and click Custom definitions.

    image-20240920-185742.png
  3. On the Custom dimensions tab, click Create custom dimension and complete the fields as follows:

    1. Dimension name = Ad source

    2. Scope = Event

    3. Description = Ad source

    4. Event parameter = ad_source

image-20240920-190242.png

View reporting in GA4

View your reporting data in Google Analytics. The following sections provide a summary of the reports you’ll want to access.

Traffic acquisition report

The traffic acquisition report shows your website's new and returning users driven by your Peacock Ad Manager campaigns.

  1. In Google Analytics, select Reports > Acquisition > Traffic Acquisition.

  2. In the dropdown menu, select Session source / medium (instead of the default “Session Default Channel Group”).

image-20240920-191123.png

To view events where GA4 did not award Peacock Ad Manager/tvScientific attribution credit but the user was exposed to a Peacock Ad Manager ad, you can filter by Ad Source.

  1. In the Traffic Acquisition report, click the + icon next to Session source / medium.

  2. Under Custom, select Ad Source. If you do not see Ad Source, add it as a custom definition to view this dimension in reporting.

    image-20240920-191246.png

Events report

This report shows how many events were driven by your Peacock Ad Manager campaigns.

  1. From the left menu, select Reports > Engagement> Events.

  2. Click Add filter.

  3. In the Dimension dropdown, select Session source.

  4. In the Match type dropdown, select exactly matches.

  5. In the Value field, select tvScientific.

    image-20240920-192116.png

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.