Import campaign data, such as aggregated cost, clicks, and impressions, from your online advertising platforms to measure return on investment (ROI) and compare performance across all your marketing initiatives.
Google Analytics combines imported campaign data with revenue and events you're already measuring, including past events.
On this page:
- About campaign data import
- Connect to an import source
- Connect to a third-party advertising platform import source
- Post import details
- Delete an import source
- Limitations
About campaign data import
Using campaign data import, Google Analytics combines your imported data from campaigns outside of Google, like email and social media advertising, with revenue and key events data in Google Analytics. This allows you to:
- Calculate non-Google metrics, such as non-Google cost per click and return on non-Google ad spend, for each campaign, source, and medium from your imported campaigns.
- Compare performance data across all of your ads initiatives. You can find this data in Reports > Acquisition > Non Google campaign and in the Advertising workspace under Planning > All channels.
Google Analytics will report your aggregated cost, impressions and clicks on any combination of the imported dimensions, giving you insights into your imported campaign data. This provides you with a more complete, accurate view of your advertising performance, leading to more well informed decisions and more effective campaign optimization.
Keep the following in mind when using campaign data import:
- Imported metrics are aggregated daily.
- You can upload data for the same campaign IDs more than once. Because the true costs for ads change as campaigns run, it’s recommended to upload new data for the same IDs daily. Analytics will use the most recent uploaded data values for reporting and exploration.
- The currency of cost imports should match the Google Analytics property currency.
The role of custom campaign URLs
To successfully combine your imported data with your collected session data, make sure that you add the following campaign tracking parameters to all destination URLs in your non-Google campaigns:
utm_idutm_sourceutm_mediumutm_campaign
Different platforms use different methods to include campaign id, name, source, and medium within an ad's click target (the link to your site that end users click). Choose auto-population features, if provided by your platforms. When those features aren’t available, you may have to provide full URLs directly to your platform.
For example: “Facebook” and “facebook” aren’t exact matches.
Learn more about how to Add utm parameters to URL
URL to campaign import values exampleA pet store is running a summer sale. They tag the destination URL contained in their advertisement with campaign measuring parameters: utm_id, utm_campaign, utm_source, utm_medium. The resulting URL would look something like this:
http://examplepetstore.com?utm_id=123_1a2b3c_abc&utm_campaign=Summer%2BSale&utm_source=ad%2Bnetwork&utm_medium=cpc&utm_term=cpc_keyword&utm_content=hero
When a user clicks an ad with this URL, their visit to the example petstore website can be associated with the Summer Sale campaign. Analytics will set the following values for the session:
|
Dimension name in Analytics |
Custom campaign parameter |
Value set in Analytics |
|
Campaign ID |
|
123_1a2b3c_abc |
|
Campaign name |
|
Summer Sale |
|
Source |
|
ad network |
|
Medium |
|
cpc |
For Google Analytics properties, Source (utm_source) and Medium (utm_medium) are required. Campaign ID (utm_id) and Campaign (utm_campaign) are optional, but can be included in the import file. 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 for reporting purposes.
You can include additional parameters in your URLs that are traditionally used in Google Analytics properties like Campaign Term (utm_term) and Campaign Content (utm_content), but they aren’t required and can’t be included in the import file.
How to import campaign data
Google Analytics supports different import sources to set up campaign data sources, depending on your preference. These import sources connect to where you store your data and commonly require you to map data from your selected import source to the Analytics fields.
Google Analytics supports third-party (3P) advertising platform import sources. These import sources are a more automated, simpler approach to importing your data directly from your advertising platforms.
Connect to an import source
You can create a connection with any of the following available import sources where you already store your data:
- Amazon Redshift
- Amazon S3
- BigQuery
- CSV
- Google Cloud Storage
- Google Sheets
- HTTPS
- MySQL
- PostgreSQL
- SFTP
- Snowflake
Prepare your campaign data for import
Keep in mind that these import sources will require you to map the import fields to the Analytics fields. Campaign ID, Campaign source, Campaign medium, and Campaign name must match the custom campaign parameters utm_id, utm_source, utm_medium, and utm_campaign that you used in your destination URL.
The following dimensions and metrics make up the structure of your imported data. Your upload file headers must match the schema you define for the corresponding import source.
Dimensions
|
Dimension |
Requirement |
|
Campaign source (utm_source) |
Required |
|
Campaign medium (utm_medium) |
Required |
|
Date (ISO 8601: YYYY-MM-DD) |
Required |
|
Campaign ID (utm_id) |
Optional, but highly recommended |
|
Campaign name (utm_campaign) |
Optional, but highly recommended |
Metrics
| Metric | Requirement |
|
|
Optional |
|
Cost (daily value in the format 0,000.00) |
Optional, but expected |
| Impressions (daily value) | Optional |
Template for CSV file upload
Below is an example CSV template for campaign data. If you need to create your upload files by hand, use this example as a guide. Download the CSV import template for campaign data.
|
utm_id |
utm_campaign |
utm_source |
utm_medium |
date |
impressions |
clicks |
cost |
|
bing_123abc |
Summer_fun |
bing |
cpc |
2020-12-01 |
12242371 |
367271 |
36727.10 |
|
facebook_456def |
Fall_delight |
|
cpc |
2020-12-01 |
3429267 |
34292 |
8573.00 |
|
twitter_789ghi |
Winter_wonderland |
|
cpc |
2020-12-01 |
9732461 |
194649 |
29197.35 |
Install the Campaign Data import tool for Google Sheets
Install the Google Sheets Plug in for 3rd party Connectors to ease set up for Google sheets import type.
Connect to a third-party (3P) advertising platform import source
You can use available third-party (3P) sources to automate the connection process for many popular platforms, making the setup much simpler and more robust. Direct 3P import sources setup will automatically run daily. Google Analytics currently supports the following direct 3P sources:
Post import details
For campaign data import, you can view 2 import health metrics in the data import details page:
- % imported: The number of rows successfully imported divided by the number of rows in the import file. 100% means all rows successfully imported. This metric helps you understand whether any of your imported data was dropped due to some error.
- Match rate: The percentage of imported rows successfully joined with Analytics data. A 100% match rate signifies that all imported rows were successfully joined. Campaign data is joined to Analytics data using the required keys (utm_source, utm_medium, and date). This calculation specifically considers the most recent 2 years of your imported data.
- Example: If you import data for the last 7 days, the match rate will show you what percentage of the 7 day imported data set was successfully joined with Analytics data. If you import 3 years of data, the match rate will show you what percentage of the most recent 2 years of the imported data set was successfully joined with Analytics data.
After you upload your data, it can take up to 24 hours for Analytics to make that data available in reports, audiences, and explorations. Users have to engage with your campaign after you upload the data in order for those metrics and campaign properties to be associated with user activity.
You can overwrite metric and dimension values by uploading new ones for the same key set.
Delete an import source
Since campaign data import uses the reporting/query time join and doesn’t alter data that has already been processed, you can simply delete a campaign data source from the data-upload service to remove campaign data from Google Analytics reports. Learn more About Data Import.
Limitations
- Campaign data: Campaign data import uses the reporting/query time join. This allows you to associate your imported campaign data with events already processed by Google Analytics.
- Match rate: This metric only considers the most recent 2 years of your imported data.
- Example: If you import data for the last 7 days, the match rate will show you what percentage of the 7 day imported data set was successfully joined with Analytics data. If you import 3 years of data, the match rate will show you what percentage of the most recent 2 years of the imported data set was successfully joined with Analytics data.
- The currency of imported campaign data should match the Google Analytics property currency.