How to extract DCM/DFA data?

706 views
Skip to first unread message

Mohammad Asif

unread,
Aug 16, 2019, 7:53:07 AM8/16/19
to Google's DoubleClick Campaign Manager API Forum
Hi,

I'm completely new to DCM/DFA, infact I started today.I have one requirement to download  report from it and load into the tables. Earlier  similar kind of requirement I did to transfer google analytics  data and load into tables on the daily basis with the help google command  line tool. but here does google provide the similar process for DCM/DFA data? I have gone through couple of links but nothing is mentioned about google command  line utility.If command line utility is not there what other approach I can follow here.
What can be the first step to achieve my goal?

DCM API (DoubleClick Campaign Mgr)

unread,
Aug 16, 2019, 11:31:54 AM8/16/19
to sam.a...@gmail.com, google-doubleclick-...@googlegroups.com

Hi Mohammad,

Can you confirm if you are trying to download the report via DCM UI interface? If so, I would recommend contacting DCM Product Support Team as they would be better to assist with your concern. If it is related to DCM API, follow the prerequisites section of this guide to get started with DCM API. Please find below the links useful for downloading reports via API. Reports are generated in CSV or EXCEL format via DCM API,  you need to post process those reports at your end to load it into the tables.
https://developers.google.com/doubleclick-advertisers/guides/download_reports
https://developers.google.com/doubleclick-advertisers/v3.3/reports

Regards,
Nikisha Patel, DCM API Team



ref:_00D1U1174p._5001UEJIbL:ref

Mohammad Asif

unread,
Aug 19, 2019, 10:04:32 AM8/19/19
to Google's DoubleClick Campaign Manager API Forum
Hi Nikisha,

Thank you for your inputs. I'm trying to download the files through python client libraries by using service account and this is going to be daily task to download the files and load into tables. I can handle the files after downloading but to download the reports is the challenging task for me. Can you please suggest me for the smooth solution or can it be done by a data transfer 2.0?

Thanks,
Asif

DCM API (DoubleClick Campaign Mgr)

unread,
Aug 19, 2019, 2:22:27 PM8/19/19
to sam.a...@gmail.com, google-doubleclick-...@googlegroups.com

Hi Asif,

You can download the python client libraries from here and follow the steps in the guide to set up the libraries. Once client libraries are installed successfully, you can use the reporting links shared in my previous mail to get started with downloading the reports. You will find this python code sample helpful to find and download the report file. Feel free to reach out if you face any issue or concern while downloading the report via DCM API.



Regards,
Nikisha Patel, DCM API Team



ref:_00D1U1174p._5001UEJIbL:ref
Message has been deleted
Message has been deleted

Mohammad Asif

unread,
Aug 20, 2019, 9:53:31 AM8/20/19
to Google's DoubleClick Campaign Manager API Forum
Hi Nikisha,

I have used the sample code mentioned in git to authenticate using service account and followed the same steps mentioned over there. but still facing the issue to authenticate by a service account. kindly find the attach python code to authenticate the service account and also the error file.
The command which I'm using to run the above code is following:
service_account_auth.py "path of my json file" -i "sam.a...@gmail.com"

Please let me know what wrong I'm doing here and help me out to get started in DCM.

Thanks,
Asif

On Tuesday, August 20, 2019 at 6:26:52 PM UTC+5:30, Mohammad Asif wrote:
Please find attached the sample client file which I'm using to authenticate the account.
service_account_auth.py
python error.txt

DCM API (DoubleClick Campaign Mgr)

unread,
Aug 20, 2019, 4:52:18 PM8/20/19
to sam.a...@gmail.com, google-doubleclick-...@googlegroups.com

Hi Asif,

Can you confirm if you generated the JSON file for you application type as per the steps mentioned in this guide? The downloaded JSON file will have the following format:

{"installed":{"client_id":"XXXXXXXXXX.apps.googleusercontent.com","project_id":"xxxxxxxxx","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://accounts.google.com/o/oauth2/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_secret":"xxxxxxxxxxxxxxxx","redirect_uris":["urn:ietf:wg:oauth:2.0:oob","http://localhost"]}}

Can you please double check your application and the steps you followed while generating the credentials and retry the request after creating the client_secrets.json file from the above guide. Feel free to reach out if the issue still persists.

Also,I had to edit your post to delete the client_secret.json file as it contained private information of your account. Please note, you should not share the sensitive information on forum thread in future.



Regards,
Nikisha Patel, DCM API Team



ref:_00D1U1174p._5001UEJIbL:ref
Message has been deleted

Mohammad Asif

unread,
Aug 21, 2019, 1:17:13 AM8/21/19
to Google's DoubleClick Campaign Manager API Forum
FYI, I have followed this link to create my service account file and had used the same code which is mentioned on this link.

On Wednesday, August 21, 2019 at 5:53:51 AM UTC+5:30, Mohammad Asif wrote:
Hi Nishika,

I will again look into my service account file and will update you here. 
One question here, If I'll use this approach, will this approach suffice my use case to download the data from dcm on the daily basis without manual intervention?
Thanks for understanding.

Thanks,
Asif

Mohammad Asif

unread,
Aug 21, 2019, 2:19:37 AM8/21/19
to Google's DoubleClick Campaign Manager API Forum
Hi Nisikha,

Sorry for the confusion here, I'm not using the user account to authenticate, I'm using the service account for authentication and below is the new error which I'm getting now after running with service account file. 

TypeError: cannot instantiate ctype 'EVP_MD_CTX' of unknown size

DCM API (DoubleClick Campaign Mgr)

unread,
Aug 21, 2019, 2:32:10 PM8/21/19
to sam.a...@gmail.com, google-doubleclick-...@googlegroups.com

Hi Asif,

The error seems to be related to the client libraries error not the API error. I recommend posting the latest concern in Python client library issue thread. They will be able to assist better with this issue.
Client library GitHub issue thread: https://github.com/googleapis/google-api-python-client/issues



Regards,
Nikisha Patel, DCM API Team



ref:_00D1U1174p._5001UEJIbL:ref

Mohammad Asif

unread,
Aug 22, 2019, 4:36:58 AM8/22/19
to Google's DoubleClick Campaign Manager API Forum
Hi Nikisha,

I'm able to figure out the issue, It's due to python package version. I'm able to run the authenticate_service_account program and it's running without issue. In this particular program there is a function to get the list of user profiles. I'm getting blank as a output. Can you please throw some light on this, I don't know how we can the user profiles list looks like. below is the sample response output.

{'kind': 'dfareporting#userProfileList', 'etag': '"some aplha numeric character"', 'items': []}

Thanks,
Asif

DCM API (DoubleClick Campaign Mgr)

unread,
Aug 22, 2019, 10:07:27 AM8/22/19
to sam.a...@gmail.com, google-doubleclick-...@googlegroups.com

Hi Asif,

As mentioned in the prerequisites section of the start up guide, you must have a user profile with access to your Campaign Manager account before using the DCM/DFA Reporting and Trafficking API. Once you have user profiles associated with the account, this code will generate the list of user profiles associated with the account in the below format.
{ "kind": "dfareporting#userProfileList", "etag": etag, "items": [ userProfiles Resource ] }



Regards,
Nikisha Patel, DCM API Team



ref:_00D1U1174p._5001UEJIbL:ref

Mohammad Asif

unread,
Aug 22, 2019, 11:25:18 AM8/22/19
to Google's DoubleClick Campaign Manager API Forum
I'm checking with my team regarding creating of user profile. Please also let me know if we have to add the service account email id to campaign manager account?

Thanks,
Asif

DCM API (DoubleClick Campaign Mgr)

unread,
Aug 22, 2019, 1:29:21 PM8/22/19
to sam.a...@gmail.com, google-doubleclick-...@googlegroups.com

Hi Asif,

A Service Account is a type of Google account that can be used by an application to access Google APIs programmatically via OAuth 2.0. Please refer to this guide for more information on Service Accounts and how to implement a service account.



Regards,
Nikisha Patel, DCM API Team



ref:_00D1U1174p._5001UEJIbL:ref

vipendra sengar

unread,
Sep 9, 2019, 6:32:49 AM9/9/19
to Google's DoubleClick Campaign Manager API Forum

Hi Nikisha,

Is there a way if we can check that the user profile is created and have access to campaign manager account. Actually we do not have access to the UI of campaign Manager, its with the client and they are able to see the reports in UI. Also Please let us know the steps required to add the user profile and providing access to campaign manager account so that we can relay the same to the client. It is like a complete road block for us, please help us on this issue. 

Thanks,
Vipendra
On Thursday, August 22, 2019 at 7:37:27 PM UTC+5:30, DCM API Forum Advisor wrote:

DCM API (DoubleClick Campaign Mgr)

unread,
Sep 9, 2019, 3:53:47 PM9/9/19
to vsengart...@gmail.com, google-doubleclick-...@googlegroups.com

Hi Vipendra,

Please find my response to your queries below.

  1. Is there a way if we can check that the user profile is created and have access to campaign manager account? Please refer this code sample to retrieve the list of all the user profiles for the current authorized user making call to the API using service account.

  2. Also, Please let us know the steps required to add the user profile and providing access to campaign manager account so that we can relay the same to the client. You can refer to the step 2 of this guide to associate the Campaign Manager user profile with the service account email.

Reply all
Reply to author
Forward
0 new messages