This article is about Google Analytics 4 properties. Refer to the Universal Analytics section if you're still using a Universal Analytics property, which will stop processing data on July 1, 2023 (July 1, 2024 for Analytics 360 properties).

[GA4] URL builders: Collect campaign data with custom URLs

Discover how to use Google Analytics 4’s URL builder to add utm parameters in order to identify the campaigns that refer traffic.

By adding utm campaign parameters to the destination URLs you use in referral links and ad campaigns, you can see which campaigns refer traffic. When a user clicks a referral link, the URL parameters are sent to Analytics and the parameter values are visible in the Traffic acquisition report.

In this article:

Add utm parameters to URL

You can add the following parameters to your destination URLs:

  • utm_id: Campaign ID. Use the same IDs that you use when uploading campaign cost data.
  • utm_source: Referrer, for example: google, newsletter4, billboard
  • utm_medium: Marketing medium, for example: cpc, banner, email
  • utm_campaign: Product, slogan, promo code, for example: spring_sale
  • utm_source_platform: The platform responsible for directing traffic to a given Analytics property (such as a buying platform that sets budgets and targeting criteria or a platform that manages organic traffic data). For example: Search Ads 360 or Display & Video 360.
  • utm_campaign_id: Used for keyword analysis to identify a specific product promotion or strategic campaign. This is a required key for GA4 data import.
  • utm_term: Paid keyword
    utm_term is not currently reported in Google Analytics 4 properties.
  • utm_content: Use to differentiate creatives. For example, if you have two call-to-action links within the same email message, you can use utm_content and set different values for each so you can tell which version is more effective.
    utm_content is not currently reported in Google Analytics 4 properties.
  • utm_creative_format: Type of creative, for example: display, native, video, search
    utm_creative_format is not currently reported in Google Analytics 4 properties.
  • utm_marketing_tactic: Targeting criteria applied to a campaign, for example: remarketing, prospecting
    utm_marketing_tactic is not currently reported in Google Analytics 4 properties.

Each parameter must be paired with a value that you assign. Each parameter-value pair then contains campaign-related information.

For example, you might use the following parameter-value pairs for your Summer Sale campaign:

  • utm_source = summer-mailer to identify traffic that results from your Summer Sale email campaign
  • utm_medium = email to identify traffic from the email campaign vs. the in-app campaign
  • utm_campaign = summer-sale to identify the overall campaign

If you used these parameters, your custom campaign URL would be:

https://www.example.com/?utm_source=summer-mailer&utm_medium=email&utm_campaign=summer-sale

When you add parameters to a URL, you should always use utm_source, utm_medium, and utm_campaign.

To learn about the traffic-source dimensions that show the parameter values, see URL builders: Collect campaign data with custom URLs.

URL builders

You can add parameters and values to your URLs manually, or you can use one of the following platform-specific URL-builder tools to create your URLs and append the parameters:

  • Links to websites: Use the Campaign URL Builder.
  • Android-app ads: Use the Play Campaign URL Builder.

    You must use the Google Analytics for Firebase SDK, but you don't need to make changes in the SDK for this feature to work.
Important: If you are advertising an Android app, use the Play Campaign URL Builder. Otherwise, you should use the Campaign URL Builder.

Manual set up

If you want to set up your custom campaigns manually, make sure you separate the parameters from the URL with a question mark. List the parameters and values as pairs separated by an equal sign. Separate each parameter-value pair with an ampersand. For example:

https://www.example.com/?utm_source=email_campaign&utm_medium=email&utm_campaign=summer-sale

You can add parameters to a URL in any order. Parameter values are case sensitive, e.g. utm_source=google is different from utm_source=Google.

Example URLs

  • http://www.example.com/?utm_source=exampleblog&utm_medium=referral&utm_campaign=summer-sale
  • http://www.example.com/?utm_source=newsletter1&utm_medium=email&utm_campaign=summer-sale
  • http://www.example.com/?utm_source=newsletter1&utm_medium=email&utm_campaign=summer-sale&utm_content=toplink

See custom campaign data

You can see Session source/medium, Session medium, Session source, and Session campaign in the Acquisition > Traffic acquisition report.

Was this helpful?
How can we improve it?

Need more help?

Sign in for additional support options to quickly solve your issue

Search
Clear search
Close search
Google apps
Main menu
Search Help Center
false
false
true
69256
false
false