Cost import to GA to multiple properties

31 views
Skip to first unread message

stav maor

unread,
Jun 21, 2015, 11:15:23 AM6/21/15
to google-analytic...@googlegroups.com
Hi,

We are running large number of campaigns in non-google platforms and we want to auto upload cost reports to google analytics using the management API.
All of the campaigns are running over multiple properties.
Is there an easy way to import them at once to Google Analytics or we have to upload separates CSV files for each UA?

Please advise(:
Thanks!

Mike Sullivan

unread,
Jun 22, 2015, 6:56:10 AM6/22/15
to google-analytic...@googlegroups.com
Since the API is structured to upload a single csv file to a single property, you will have to split the data and upload independently.

Matthew Cohoon

unread,
Jun 22, 2015, 12:50:08 PM6/22/15
to google-analytic...@googlegroups.com
If you are using one of the client libraries you should be able to write a simple for loop to upload a single file to all the desired property/data sources.

for account, property, dataSource in dataSourceList:
  media = MediaFileUpload('data.csv',
                          mimetype
='application/octet-stream',
                          resumable
=False)
  daily_upload
= analytics.management().uploads().uploadData(
      accountId=account
,
      webPropertyId=property
,
      customDataSourceId=dataSource
,
      media_body
=media).execute()


But if you plan to do more then 10 at a time you might hit the user rate limit.
-Matt

--
You received this message because you are subscribed to the Google Groups "Google Analytics Management API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-analytics-mana...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages