DCM/DFA Profile Id?

5,564 views
Skip to first unread message

cdsim...@gmail.com

unread,
Feb 23, 2016, 2:46:07 PM2/23/16
to Google's DoubleClick Campaign Manager API Forum
I'm having trouble with the notion of a Profile Id and where to find it or how to configure/link it.  I'm trying to set up a service account to allow us to periodically pull data from DFP (does the api work with DFP?) and store it internally for some automated reporting processes.

Everything I've found over the past few days seems to point to a misconfiguration on my part, centered around the Profile Id, that I just can't seem to figure out.  I have no problem querying the userprofiles.list service, but it returns an empty array of profileids.  The result is the same when querying via the API Explorer as myself or via the python script I've written as my service account  

At one point I resorted to somewhat-blindly trying any "id" I could get my hands on including my google account id, user ids in DFP, and the network id for the company.  All result in "User Profile ID not found" errors.  The only different message I received was when I tried using a Contact ID, and I received an error indicating I was not authorized to use that id.

I think I'm having a fundamental misunderstanding around the profile id and I could really use some guidance to get this thing off the ground.

Jonathon Imperiosi (DCM API Team)

unread,
Feb 23, 2016, 2:53:15 PM2/23/16
to Google's DoubleClick Campaign Manager API Forum, cdsim...@gmail.com
Hi there,

This API is specifically for working with DCM and DDM Reporting, not DFP. If you're interested in working with DFP, you should take a look at the documentation here.

As far as DCM is concerned, you can look up the profile IDs your Google account has access to using the userProfiles service, as you've found. If the response from userProfiles.list comes back empty, it means that there are no DCM user profiles associated with the account making the request. Be aware, that DCM user profiles cannot be directly associated with service accounts. Service accounts are only supported via domain wide delegation (see this guide for details).

Regards,
- Jonathon Imperiosi, DCM API Team

cdsim...@gmail.com

unread,
Feb 23, 2016, 3:00:52 PM2/23/16
to Google's DoubleClick Campaign Manager API Forum, cdsim...@gmail.com
Well, I've been questioning my sanity for a few days, now.  I didn't realize there was a specific DFP API.  I'll check out out and take my questions over there if I still have problems.  Thanks!

Rakesh Kurulkar

unread,
Oct 1, 2018, 4:44:28 PM10/1/18
to Google's DoubleClick Campaign Manager API Forum
I am currently working with DCM/DFA Reporting API. I am getting blank userProfiles list. What steps do I need to take in order to get access to this API?

Lakshmi Prathipati (DCM API Team)

unread,
Oct 2, 2018, 3:05:06 PM10/2/18
to Google's DoubleClick Campaign Manager API Forum
Hi,

As mentioned by Jonathon on this thread, if you don't have any user profiles associated with the given email then the response will be empty for userprofiles.list. Please check here for the prerequisites that are required to access DCM API. If you have a user profile, then I recommend using this API explorer and see if you get the associated user profile in the response.

Thanks,
Lakshmi, DCM API Team

Rakesh Kurulkar

unread,
Oct 2, 2018, 3:50:50 PM10/2/18
to google-doubleclick-...@googlegroups.com
Thanks for the response. May be I should elaborate my problem here. We are building an application to access data so that we can have some sort of dashboard. Advertising Agency own Campaign Manager account. We want to access the API using service account since it will be server to server call using python SDK.  So basically I would be using below code from GIT for service account based authentication & authorization.

I have asked Campaign Manager account owner (Agency in our case) to add our service account email id as user profile to the Campaign Manager account. Is this the right step? Initially the email id which we used to create service account was used to create the user profile. This email id is not google email id and is official id of the company. This may be the reason we are getting blank userprofiles list. Would adding service account email id solve this problem?

--
You received this message because you are subscribed to the Google Groups "Google's DoubleClick Campaign Manager API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-doubleclick-for-ad...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Lakshmi Prathipati (DCM API Team)

unread,
Oct 3, 2018, 3:13:34 PM10/3/18
to Google's DoubleClick Campaign Manager API Forum
Hi,

Thanks for clarifying the issue. If you are using the service account email address just to make the DCM API calls, but not to impersonate the person then yes, you need to add the service account email address (ends with @developer.gserviceaccount.com) as a user profile in the DCM account. Please check this Service account guide for more information.

Thanks,
Lakshmi, DCM API Team

On Tuesday, October 2, 2018 at 3:50:50 PM UTC-4, Rakesh Kurulkar wrote:
Thanks for the response. May be I should elaborate my problem here. We are building an application to access data so that we can have some sort of dashboard. Advertising Agency own Campaign Manager account. We want to access the API using service account since it will be server to server call using python SDK.  So basically I would be using below code from GIT for service account based authentication & authorization.

I have asked Campaign Manager account owner (Agency in our case) to add our service account email id as user profile to the Campaign Manager account. Is this the right step? Initially the email id which we used to create service account was used to create the user profile. This email id is not google email id and is official id of the company. This may be the reason we are getting blank userprofiles list. Would adding service account email id solve this problem?

On Tue, Oct 2, 2018 at 9:05 PM 'Lakshmi Prathipati (DCM API Team)' via Google's DoubleClick Campaign Manager API Forum  wrote:
Hi,

As mentioned by Jonathon on this thread, if you don't have any user profiles associated with the given email then the response will be empty for userprofiles.list. Please check here for the prerequisites that are required to access DCM API. If you have a user profile, then I recommend using this API explorer and see if you get the associated user profile in the response.

Thanks,
Lakshmi, DCM API Team

On Monday, October 1, 2018 at 4:44:28 PM UTC-4, Rakesh Kurulkar wrote:
I am currently working with DCM/DFA Reporting API. I am getting blank userProfiles list. What steps do I need to take in order to get access to this API?

On Tuesday, 23 February 2016 20:53:15 UTC+1, Jonathon Imperiosi (DCM API Team) wrote:
Hi there,

This API is specifically for working with DCM and DDM Reporting, not DFP. If you're interested in working with DFP, you should take a look at the documentation here.

As far as DCM is concerned, you can look up the profile IDs your Google account has access to using the userProfiles service, as you've found. If the response from userProfiles.list comes back empty, it means that there are no DCM user profiles associated with the account making the request. Be aware, that DCM user profiles cannot be directly associated with service accounts. Service accounts are only supported via domain wide delegation (see this guide for details).

Regards,
- Jonathon Imperiosi, DCM API Team

On Tuesday, February 23, 2016 at 2:46:07 PM UTC-5, wrote:
I'm having trouble with the notion of a Profile Id and where to find it or how to configure/link it.  I'm trying to set up a service account to allow us to periodically pull data from DFP (does the api work with DFP?) and store it internally for some automated reporting processes.

Everything I've found over the past few days seems to point to a misconfiguration on my part, centered around the Profile Id, that I just can't seem to figure out.  I have no problem querying the userprofiles.list service, but it returns an empty array of profileids.  The result is the same when querying via the API Explorer as myself or via the python script I've written as my service account  

At one point I resorted to somewhat-blindly trying any "id" I could get my hands on including my google account id, user ids in DFP, and the network id for the company.  All result in "User Profile ID not found" errors.  The only different message I received was when I tried using a Contact ID, and I received an error indicating I was not authorized to use that id.

I think I'm having a fundamental misunderstanding around the profile id and I could really use some guidance to get this thing off the ground.

--
You received this message because you are subscribed to the Google Groups "Google's DoubleClick Campaign Manager API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to

Rakesh Kurulkar

unread,
Oct 5, 2018, 1:48:10 PM10/5/18
to google-doubleclick-...@googlegroups.com
Thanks a lot. It worked for me. 

To unsubscribe from this group and stop receiving emails from it, send an email to google-doubleclick-for-ad...@googlegroups.com.

Rakesh Kurulkar

unread,
Oct 8, 2018, 12:22:21 PM10/8/18
to google-doubleclick-...@googlegroups.com
Hi Lakshmi Prathipati,
I need one help in DCM DFA Reporting API. Please refer to attached word document which illustrates input and output command on python shell. I need to create the report with list of dimensions but I don't want to filter on any specific dimension. All I need to filter on is dateRange which I have specified in the report criteria. I have specified dimensions that I need in report in the Dimensions list of report criteria. I have mentioned couple of metricNames as well ( I need more metrics but I will specify it later)

when I execute inserted_report = service.reports().insert(profileId=profile_id, body=report).execute(), I am getting report_id as well which I want to use for executing the report. But when I run this command
report_file = service.reports().run(profileId=profile_id, reportId=report_id).execute()
I am getting below error
HttpError: <HttpError 400 when requesting https://www.googleapis.com/dfareporting/v3.2/userprofiles/1234567/reports/159018411/run?alt=json returned "Please choose at least one dimension to report on.">

I have masked profile id with 1234567 here just for illustration.

Can you please let me know what I am missing?
Create DCM Report.docx

Lakshmi Prathipati (DCM API Team)

unread,
Oct 8, 2018, 3:20:38 PM10/8/18
to Google's DoubleClick Campaign Manager API Forum
Hi,

In general this error occurs when we are giving just metrics in the criteria with out any dimensions. However, I see dimensions in the attached document. Are you able to create and run the report in the UI? If you are able to do in the UI and fails only in the API, I need the following details in a private message:
  1. Assuming that the given report id is valid, send the profile id
  2. API request and response in JSON format (include the HTTP request as well)
  3. DCM account id
  4. Report id and file id of the report created in the UI
Pleas create a new thread and then send a private message when you are sending the above details as this is a new issue.

Thanks,
Lakshmi, DCM API Team

On Monday, October 8, 2018 at 12:22:21 PM UTC-4, Rakesh Kurulkar wrote:
Hi Lakshmi Prathipati,
I need one help in DCM DFA Reporting API. Please refer to attached word document which illustrates input and output command on python shell. I need to create the report with list of dimensions but I don't want to filter on any specific dimension. All I need to filter on is dateRange which I have specified in the report criteria. I have specified dimensions that I need in report in the Dimensions list of report criteria. I have mentioned couple of metricNames as well ( I need more metrics but I will specify it later)

when I execute inserted_report = service.reports().insert(profileId=profile_id, body=report).execute(), I am getting report_id as well which I want to use for executing the report. But when I run this command
report_file = service.reports().run(profileId=profile_id, reportId=report_id).execute()
I am getting below error
HttpError: <HttpError 400 when requesting https://www.googleapis.com/dfareporting/v3.2/userprofiles/1234567/reports/159018411/run?alt=json returned "Please choose at least one dimension to report on.">

I have masked profile id with 1234567 here just for illustration.

Can you please let me know what I am missing?

Thanks a lot. It worked for me. 

On Thu, 4 Oct 2018, 12:43 a.m. 'Lakshmi Prathipati (DCM API Team)' via Google's DoubleClick Campaign Manager API Forum,
Hi,

Rakesh Kurulkar

unread,
Oct 9, 2018, 8:10:53 AM10/9/18
to google-doubleclick-...@googlegroups.com
Hi Lakshmi,
I found the issue in my code. May be this will help others as well. The way I should define multiple dimensions in report criteria should be like this
  criteria = {
      'dateRange': {
          'startDate': start_date.strftime('%Y-%m-%d'),
          'endDate': end_date.strftime('%Y-%m-%d')
      },
      'dimensions': [
             {'name':'dfa:advertiser'},
        {'name':'dfa:advertiserId'},
        {'name':'dfa:campaignEndDate'},
        {'name':'dfa:campaignId'},
        {'name':'dfa:campaign'},
        {'name':'dfa:campaignStartDate'},
        {'name':'dfa:activityGroup'},
        {'name':'dfa:activityId'},
        {'name':'dfa:activity'},
        {'name':'dfa:clickThroughUrl'},
        {'name':'dfa:creativeType'},
        {'name':'dfa:creativeId'},
        {'name':'dfa:creative'},
        {'name':'dfa:date'},
        {'name':'dfa:platformType'},
        {'name':'dfa:contentCategory'},
        {'name':'dfa:placementCostStructure'},
        {'name':'dfa:placementEndDate'},
        {'name':'dfa:placementId'},
        {'name':'dfa:placement'},
        {'name':'dfa:packageRoadblockId'},
        {'name':'dfa:packageRoadblock'},
        {'name':'dfa:placementSize'},
        {'name':'dfa:placementStartDate'},
        {'name':'dfa:placementStrategy'},
        {'name':'dfa:adId'},
        {'name':'dfa:ad'}
      ],
      'metricNames': ['dfa:clicks', 'dfa:impressions']
  }

To unsubscribe from this group and stop receiving emails from it, send an email to google-doubleclick-for-ad...@googlegroups.com.

Lakshmi Prathipati (DCM API Team)

unread,
Oct 9, 2018, 2:59:56 PM10/9/18
to Google's DoubleClick Campaign Manager API Forum
Hi,

I'm glad that you were able to resolve the issue. Just let us know if you have any further questions.

Thanks,
Lakshmi, DCM API Team

On Tuesday, October 9, 2018 at 8:10:53 AM UTC-4, 
Reply all
Reply to author
Forward
0 new messages