Traffic source fields & dimensions

Traffic Source Fields & Dimensions

Published:

Written by:

The traffic source fields within the GA4 BigQuery export provide information on the acquisition source for each event, and the initial traffic source that led to the user’s first interaction with your platform.

The collection of data within these fields can depend on the configuration of various product integrations within Google Analytics, as well as the inclusion of UTM parameters in the links leading to your site or app.

Note, this information is collected in 2 different records:

  • collected_traffic_source – contains the information collected with the event
  • traffic_source – contains the information collected on the user’s first visit
Field NameData TypeDescriptionExample Values
collected_traffic_source.manual_campaign_idSTRINGCampaign id value (utm_id) collected with the event1, 2, A, B, etc.
collected_traffic_source.manual_campaign_nameSTRINGCampaign name value (utm_campaign) collected with the event(organic)
(referral)
collected_traffic_source.manual_sourceSTRINGSource value (utm_source) collected with the eventgoogle
bing
m.facebook.com
collected_traffic_source.manual_mediumSTRINGMedium value (utm_medium) collected with the eventorganic
email
paid search
collected_traffic_source.manual_termSTRINGKeyword/term (utm_term) collected with the eventA value unique to your business
collected_traffic_source.manual_contentSTRINGContent value (utm_content) collected with the eventA value unique to your business
collected_traffic_source.gclidSTRINGThe Google click identifier collected with the eventCj0KCQjw2…
collected_traffic_source.dclidSTRINGThe Google Marketing Platform (GMP) identifier collected with the eventCInBiqX13v…
collected_traffic_source.srsltidSTRINGThe Google Merchant Center identifier collected with the eventEAIaIQobC…
traffic_source.nameSTRINGCampaign name value (utm_campaign) captured on the user’s first visit(organic)
(direct)
traffic_source.mediumSTRINGMedium value (utm_medium) captured on the user’s first visitorganic
email
paid search
traffic_source.sourceSTRINGSource value (utm_source) captured on the user’s first visitgoogle
bing
(direct)

Sample traffic source fields query

Select the traffic source fields you need from the below query.

SELECT
  collected_traffic_source.manual_campaign_id,
  collected_traffic_source.manual_campaign_name,
  collected_traffic_source.manual_source,
  collected_traffic_source.manual_medium,
  collected_traffic_source.manual_term,
  collected_traffic_source.manual_content,
  collected_traffic_source.gclid,
  collected_traffic_source.dclid,
  collected_traffic_source.srsltid,
  traffic_source.name,
  traffic_source.medium,
  traffic_source.source
FROM `<project>.<dataset>.<table>`

Important Note: Make sure you replace the placeholders within the WHERE clause with the specific values for the table you are working with. For example, if you want to extract data for January 31st 2021 from the e-commerce sample dataset, use the following values:

  • <project> should be replaced with bigquery-public-data
  • <dataset> should be replaced with ga4_obfuscated_sample_ecommerce
  • <table> should be replaced with events_20210131

Ensure that you substitute these placeholders with your actual project, dataset, and table names when executing the queries.


For details and examples of other fields & dimensions see:

New to the GA4 BigQuery export? Check out our free introductory guide.

X