Importing cost data - MartijnSch/gattica GitHub Wiki

Importing cost data to Google Analytics

In order to import cost data in to Google Analytics you need to make sure that you've set up a custom data import for the sources that you would like to import. More information on this can be found here in the Google Analytics help guides. There are some required fields that you need to add in order to make this work: ga:date, ga:medium, ga:source, ga:adClicks, ga:adCost, ga:impressions, ga:campaign.

Note: When you set up a custom data source, you'll get a custom data source ID. You'll need it in order to use the bin/import_cost_data.rb file to import your cost data.


Requirements: a custom data source ID, a Google Analytics Account ID, a Google Analytics Web Property ID, a working oAuth2 access token with proper access level to the Google Analytics Management API.

Data sources

Currently the bin/import_cost_data.rb file supports three social networks: LinkedIn, Facebook, Twitter and Bing Ads. If you would like to see support for more networks, add a ticket!

LinkedIn

In order to use LinkedIn, you can download your performance data directly from their admin panels. It will contain all the needed information to upload the data.

Other

In order to use the data for the other networks. You'll need to export the data in the formats that they require and clean some of the data yourself as these networks don't create a go-to ready CSV file that you can import.