[UA] About Cost Data

Compare performance data across all your advertising initiatives.

Cost Data Import allows you to leverage the Analytics platform to perform return-on-investment (ROI) analysis and compare campaign performance for all your online advertising and marketing investments.

In this article:

How Cost Data import works

To use Cost Data import, you join uploaded data generated by non-Google campaigns, such as keywords from search engines, email marketing campaigns, and social media advertising. Analytics then combines this cost data with revenue and conversion data to calculate metrics like ROAS (Return on Ad Spend) and RPC (Revenue per Click) for each campaign, search engine, ad, and keyword. This allows you to compare performance data across all your ad initiatives.

The role of custom campaign URLs

The key to performing ROI analysis on paid campaigns is adding custom campaign tracking parameters to all destination URLs in the non-Google ad system you're using. This lets you join cost data from those external sources with session data in Analytics.

See an example of campaign tagging


A pet store is running a summer sale. They tag the destination URL contained in their advertisement with campaign tracking parameters (utm_campaign, utm_source, utm_medium, utm_term). The resulting URL would look something like this:




When the user clicks an ad with this URL, their visit to the pet store website can now be associated with the summer sale campaign. Analytics will set the following values for the session:


Dimension Name in Analytics Web Interface Campaign tracking parameter Value set in Analytics
Campaign Name utm_campaign Summer Sale
Source utm_source ad network
Medium utm_medium cpc
Keyword utm_term dogbone


This ensures that Analytics has the campaign tracking parameters associated with the session and that there is a way to join Analytics data with the external cost data source.

The URL builder tool can help you tag your custom campaign URLs properly.

Data Set schema

The Data Set is the container that will hold your imported data. Expand the section below to see the Data Set schema details.

Data Set details


  • Scope—the scope determines which hits will be associated with the import dimension values. There are four levels of scope: hit, session, user and product. Learn more about scope.
  • Schema—lists the dimensions and metrics that make up the structure of your imported data. Your upload file headers must match the schema you define for that Data Set.
The dimensions and metrics listed for the schema are for reference only and may not be complete; the actual dimensions and metrics available will appear in the user interface when you create the Data Set.
Scope Hit
Schema The following dimensions are required:
  • Medium
  • Source

You must include at least one of the following dimensions:

  • Clicks
  • Cost
  • Impressions

Finally, you can upload any or all of these dimensions:

  • Ad Content
  • Ad Slot
  • Position
  • Google Ads
  • Google Ads Ad Group
  • Campaign ID
  • Google Ads Criteria ID
  • Campaign
  • Destination URL
  • Display URL
  • Keyword
  • Matched Search Query
  • Referral Path

The date dimension will also be added to the schema displayed by clicking Get schema. Be sure your upload file includes ga:date in the header, as well as the relevant dates in the data.

Any metric that is omitted will be assumed to have a value of 0.

The dimension previously identified as Ad Group has been renamed Google Ads Ad Group. The only ad-group data you can upload is Google Ads cost data (as opposed to ad-group data from other platforms like Twitter or Facebook).

Limits of Cost Data import

Cost Data import uses query time import mode. This allows you to associate your imported cost data with hits already processed by Analytics. However, if you are using search and replace filters to change your data as it's processed, be sure you are using the correct, post-filtered values in your imported data.

Was this helpful?

How can we improve it?
Choose your own learning path

Check out google.com/analytics/learn, a new resource to help you get the most out of Google Analytics 4. The new website includes videos, articles, and guided flows, and provides links to the Google Analytics Discord, Blog, YouTube channel, and GitHub repository.

Start learning today!

Clear search
Close search
Google apps
Main menu
Search Help Center