Tuesday, 5 April 2016

use Python to download reports from multiple accounts

Hi,
Written a Python code to download reports (e.g. AD_PERFORMANCE_REPORT ), am using my mcc account to get reports for a client account, now i want to get reports of many client accounts (all under the same mcc manager account).
I am new to python (and programming), so I have few questions to fill up my knowledge gaps so I can tailor the best solution. 

1)
I used this sample code: create_adwords_client_without_yaml.py (https://github.com/googleads/googleads-python-lib/blob/master/examples/adwords/authentication/create_adwords_client_without_yaml.py)
just filled all the variables with my token etc., and used the CLIENT_CUSTOMER_ID of my MCC. 
So my first question is - what exactly this code does? 
My app didn't work until I run this piece of code, but I cannot understand -is this something you need to run once? like to "register" your application? Or is it initiating some session that gets expired after a while? 
Also - I am using yaml file. It works fine but the sample says "without_yaml" so I'm obviously not using it the way i should have, but I am not sure how my yaml file is related to this sample code (some fields are obviously duplicated, but the CLIENT_CUSTOMER_ID is not the same, in the yaml i use the one of the client account, not the mcc). 

2)
So in my ymal file I field my token etc. (same as in the aforementioned sample code), but here i use the CLIENT_CUSTOMER_ID is the client account. 
So as far as I understand it, every time I want to get the report for a different client account (under the same mcc), I need to switch to a different ymal file (like if i'll hold many yaml files, one for each client account, and pass a variable with the correct file path to LoadFromStorage(MY_CLIENT_YAML_PATH) ) - is this the right way to go?

3)
Is there a way to get all the AD_PERFORMANCE_REPORT reports for all the client accounts under my mcc account?
My current solution is to write the AWQL I need, then iterate and run the query on each account one at a time (pointing to the different yaml files as described in question 2 above) - is this the way to go?

I've went through all training materials I found and couldn't quite find my answers, so I'll mighty appreciate any guidance. 

Thanks !


--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups "AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/399e1f2f-bcf0-444b-a65e-e4b3f77375ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment