This article shows you how to import ad spend cost data into Google analytics so that you can compare and measure the ROI of your different marketing campaigns. This includes campaign ad spend from Social Media, Banner Ads, Bing ads, Affiliate advertising and any other paid advertising that isn’t Google.
Why do it?
Importing your cost data into Google Analytics allows you to report on advertising directly within Google Analytics. Having the data directly within Google Analytics can be useful as it means you can report the ad spend and performance across multiple channels and campaigns. This can help with organisational reporting if Google Analytics is your main data source for website reporting. It also allows you to calculate and a cost per visitor or cost per action. Below is an example of the Cost Analysis report found within GA.
How is it done?
1. Ensure you are correctly tracking your existing campaigns!
Before you start you need to ensure you are seeing campaign and source and medium data within Google Analytics. You should be using utm tracking on all links for non-google campaigns in order to track campaign traffic in GA. This tells Google analytics where the visit came from. If you do not do this your campaign data won’t get passed and you will not be able to distinguish between paid and non paid activity. You can read up on how to use utm tagging here. You will need to include source, medium as well as a campaign name. A good naming structure might look something like the below where utm source is the network platform and the medium set as ‘paidsocial’ for links from ads and ‘organicsocial’ for non paid links.
2. Setup a data source within GA (Do this just once)
To do this go into Admin panel of GA and under the Properties column look for ‘Data Import‘option. You will need Admin privileges to do this. Click into it and click create new data source and select ‘Cost data’ from the list. From there give your data source a name.
We will need Date, Medium, Source and Cost so select these.
Under Import Behaviour, choose what you want to do when imported data is repeated, for example when existing ad spend has already uploaded to GA. If you want to add the new data to the existing data, choose Summation. If you want the existing data to be replaced with the new data, choose Overwrite (Recommended). Next, save the changes and you’ll see a new data set in the Data Import menu.
3. Get Your Campaign and Cost Info Together
You will need export your campaign cost data from your social media account or wherever it lives. Ad spend data is easily available to export from most systems like facebook so export this data out or make a note of the spend for each campaign.
Prep Your data via CSV:
Provided you already campaign and source data within Google Analytics. You can proceed with importing your cost data. We will only really need 5 columns if we just want to report on cost against campaign and platform. Get your data into a csv spreadsheet with the following headers:
campaign name (ga:campaign), Source (ga:source), Medium (ga:medium), ad spend (ga:adcost) and date (ga:date)
Be sure to make sure your campaign name source and medium is written exactly the same as it appears in Google Analytics. Your date will need to be in the format of YYYMMDD but you can easily format this within excel. Also ensure you do not have any blank row spaces in your spreadsheet.
Note: If you want to report on a day by day I would recommend you include daily data. If you only need to report by month and don’t want the hassle of segmenting by day then you can just include one date i.e (1st of each month) and assign total ad spend for that month to that date.
4. Upload Data
Now you are ready to upload your file. Hit ‘Upload File’. If successful the status will show as completed. If it fails the status box will display as failed with the reason as to what the error was. Future data can be uploaded by simply uploading an updated csv spreadsheet.
Report on imported data within GA
Uploaded data needs to be processed before it can show up in reports .Once imported it can take up to 24 hours to show (but usually a lot less from experience) so be patient.
You can report on your imported data using standard reports or custom reports. You can to the Acquisitions > Campaigns> Cost Analysis report to see whether your data is available.
What if I mess up the data or need to amend?
If you discover you have imported the wrong cost data or need to update your data, you can do by repeating the steps above and choose the ‘Overwrite’ option when re-importing again.
Summary
Using GA to report on ad spend across channels can be useful, but it is a little time consuming to do due to the manual process so you might just want to limit it to a monthly or quarterly reporting. Entering ad spend for the full month as opposed to individual days is quicker and easier but limits you to full month reporting only (with no daily breakdown), but for some this could be fine. Have a go yourself and see what interesting reports you can generate with adspend included. If you require further help and advice then get in touch with one of our team.