Cost Data import example
Importing and analyzing 3rd party (non-Google) ad network clicks, cost, and impression data alongside collected Analytics data gives you a more complete picture of your online advertising performance than without this data.In this article:
Bob is the marketing manager for an online pet store. Bob wants to run a Spring Sale campaign, using keywords purchased from both Google AdWords and a non-Google ad network. Bob would like to know how well the keywords on both platforms perform compared to each other. Bob has linked his AdWords and Analytics accounts, so he automatically gets those metrics in his Analytics reports. But for the non-Google ads, he'll need to upload the click and cost data.
Step One: Tag campaign URLs
Following the guidelines in the Custom Campaigns article, Bob provides tagged URLs to the ad network with his desired Source, Medium, Campaign and Keyword values, such as shown in the example below:
http://www.example.com/?utm_source=ad%20network&utm_medium=cpc&utm_term=dogbone&utm_campaign=Spring%20Sale http://www.example.com/?utm_source=ad%20network&utm_medium=cpc&utm_term=dog%20treats&utm_campaign=Spring%20Sale http://www.example.com/?utm_source=ad%20network&utm_medium=cpc&utm_term=pet%20store&utm_campaign=Spring%20Sale
Step Two: Create the Data Set
Bob wants to track clicks, cost and ad impressions for the Spring Sale campaign. He'll need to create a Data Set to hold this data and assign the Data Set to at least one view. Here are the steps to do this:
- Sign in to Google Analytics.
- Click Admin, and navigate to the property to which you want to upload data.
- In the PROPERTY column, click Data Import to display the Data Sets table.
- Click the +New Data Set button.
- Select the Cost Data type.
- Name the Data Set
- Select one or more views to associate with this Data Set.
- Define the Data Set schema to include these dimensions and metrics:
- Click Save.
- Click Get Schema and copy the Data Set schema for use in Step Four below.
The schema consists of a Key (one or more dimensions and/or metrics used to match uploaded data to existing hits) and one or more imported dimensions and/or metrics, which hold the additional data you are uploading.
Step Three: Download the data
After the Spring sale campaign has run for a few days, Bob uses an export tool provided by the ad network to download aggregated daily data and saves it as a CSV file. The example below shows a few lines from that file:
Date,Campaign Name,Keyword,Impressions,Clicks,Spend 6/11/2014,Spring Sale,dogbone,9387,288,100.3 6/11/2014,Spring Sale,dog treats,1684,52,19.35 6/11/2014,Spring Sale,pet store,3187,143,76.23 6/12/2014,Spring Sale,dogbone,10005,356,121.67 6/12/2014,Spring Sale,dog treats,1534,68,25.16 6/12/2014,Spring Sale,pet store,3398,201,80
As fascinating as this data is, the file needs a few changes:
- The column headers provided by the ad network don't match the names expected by Analytics.
- The Source and Medium dimensions are missing.
- The date format should be in YYYYMMDD style.
Bob will need to fix these issues before he can upload the data.
If you are using Google Sheets to format your CSV file, you can use the custom number format feature to output the date field in
yyyyMMdd format. Learn more about formatting numbers and dates.
Step Four: Modify the CSV
Bob opens the CSV in his favorite spreadsheet program file and modifies it to meet the format required by Analytics. Specifically, he changes the column headers to match the Analytics dimension and metric names, adds the missing dimensions and values, and changes the date format. His data now looks like this:
The CSV file is now ready to be uploaded to Analytics. Bob saves it as "adnetwork_springsale_2014-09-12.csv".
Step Five: Upload the data to Analytics
Upload cost data using the web interface
Bob returns to his Analytics account and displays the Manage Uploads page for data set that holds the Spring Sale cost data by:
- Clicking Admin in the menu bar at the top of any page.
- In the ACCOUNT column, selecting the Analytics account that contains the parent property for the data set.
- In the PROPERTY column, selecting the property that contains the data set.
- Clicking Data Import. This displays the Data Sets table.
- Clicking the Manage Uploads link for the Spring Sale data set.
- Clicking the Upload file button.
Bob has been careful to make sure his uploaded data file is formatted correctly, so the upload succeeds. (However, if there had been an error, Bob would see that reflected in the Status column of the uploads table.)
Upload cost data using the Management API
Bob can also upload his cost data using the Management API.
Step Six: See the data in reports
Phew! Bob can finally see how his ad network keywords are performing by running the Cost Analysis Report. This report shows visit, cost, and revenue performance data for your paid marketing channels. Bob can also create custom reports using his uploaded data.
Uploaded data needs to be processed and joined with your existing data. It may take up to 24 hours before the imported data appears in reports.