Question on API Report Request for floodlightVariableDimension1-100, dfa:floodlightVariableMetric1-100 and attribution model.

157 views
Skip to first unread message

Mike Schwartz

unread,
Nov 13, 2018, 2:32:38 PM11/13/18
to Google's DoubleClick Campaign Manager API Forum
All  - My goal replicate a report that exists in the web interface and automate this across all the campaigns we manage.   The example report  includes activity names and the corresponding activity metric total conversions using the attribution model (Time Decay).  In attempting to complete this task I've  run into a couple of questions.  

First:  I'm struggling to understand how to request activity names in the report (give me the friendly name string) and corresponding value.   In reviewing the v3.2  dimensions and metrics website, it looked like a metric name (floodlightVariableDimension1-100) and metric value (dfa:floodlightVariableMetric1-100) existed for this purpose.  Given the error being returned, I'm wondering if that is the intended use?   In using the below code to create the report an error is returned "The combination of dimensions, metrics, and filters in your report is invalid." and I'm looking for help/example of intended usage in C# to achieve the goal of capturing activity names and the corresponding Total Conversion metric .

The second question I have is regarding specification the Attribution Model via the API.   The example report I'm trying to replicate from the web interface and automate has this field specified with a value of "Time Decay".  How do I specify an attribution model when creating a report?

Thanks in advance for your help,
Mike

*******************************
Current code for creating the report described above:


 public long? CreateDCMReport(long userProfileID, string reportName, DateRange dateRange)
{

// Create the criteria for the report.
Report.CriteriaData criteria = new Report.CriteriaData();
criteria.DateRange = dateRange;
SortedDimension dfaDate = new SortedDimension();
dfaDate.Name = "dfa:date";
SortedDimension creativeId = new SortedDimension();
creativeId.Name = "dfa:creativeId";
SortedDimension adId = new SortedDimension();
adId.Name = "dfa:adId";
SortedDimension floodlightVariableDimension1 = new SortedDimension();
floodlightVariableDimension1.Name = "dfa:floodlightVariableDimension1";
SortedDimension floodlightVariableDimension2 = new SortedDimension();
floodlightVariableDimension2.Name = "dfa:floodlightVariableDimension2";


   criteria.Dimensions = new List<SortedDimension>() { dfaDate,
    adId,
    creativeId,
    floodlightVariableDimension1,
    floodlightVariableDimension2   // removed 3-100 to simplify example
   }

    criteria.MetricNames = new List<string>() {
    "dfa:activityClickThroughConversions",
     "dfa:activityViewThroughConversions",
     "dfa:floodlightImpressions",
     "dfa:totalConversions"
     "dfa:floodlightVariableMetric1",
     "dfa:floodlightVariableMetric2"  // removed 3-100 to simplify example
       }  

//Create the report and add the critera, name and type      
Report report = new Report();
report.Criteria = criteria;
report.Name = reportName;
report.Type = "STANDARD";
//create the report in DCM
Report result = service.Reports.Insert(report, userProfileID).Execute();      
     
return result.Id;
}
**********************
Error returned when creating the above report:

The combination of dimensions, metrics, and filters in your report is invalid. [400]
Errors [
        Message[The combination of dimensions, metrics, and filters in your report is invalid.] Location[ - ] Reason[invalid] Domain[global]
]
************************      

Lakshmi Prathipati (DCM API Team)

unread,
Nov 13, 2018, 4:21:22 PM11/13/18
to Google's DoubleClick Campaign Manager API Forum
Hi,

As mentioned in this guide, I recommend creating the report in the UI first then retrieve the saved UI report via API report to get an idea on valid Reporting structure, specifying the values  and valid combination of dimensions and metrics.  Using DCM API, we have (limited) support for custom Floodlight attribution models in Report Builder. When running a report via the API, you can specify model by using a special filter dfa:attributionModelConfig.  Here is an example of what this would look like in your request:
dimensionFilters": [
   {
    "kind": "dfareporting#dimensionValue",
    "etag": "ETAG_VALUE_HERE"",
    "dimensionName": "dfa:attributionModelConfig",
    "id": "YOUR_ID_HERE",
    "matchType": "EXACT"
   }
  ]

Even for attribution models, I would recommend first to create the report in the UI.

Thanks,
Lakshmi, DCM API Team

Mike Schwartz

unread,
Nov 14, 2018, 10:54:00 AM11/14/18
to Google's DoubleClick Campaign Manager API Forum
Hi Lakshmi - Thanks for the help on the attribution model.    Regarding the activity, I have a report created in the UI with the appropriate fields (not sure if there's a private way to share the report for you to review),   I've only included fields in the example code that exist in the UI.   The part I'm still trying to understand is how to add the activities section that appears in the UI, and how that translates to the API.  Each activity listed in the UI report has a customized name (string) relative to that specific campaign.  We manage many campaigns and capturing each of the specific names to run  every report that used this concept seems like a lot of overhead and that there would be a better way to handle via the API.  Is there a way, from the API, to retrieve the list of activity names that exist for each campaign?  Or is there another path here that I should review?

Thanks for your help,
Mike

Lakshmi Prathipati (DCM API Team)

unread,
Nov 14, 2018, 3:30:09 PM11/14/18
to Google's DoubleClick Campaign Manager API Forum
Hi Mike,

If you have created the report in the UI and saved it, then you can pull that UI report via API to see the valid structure. For this you need to use Reports.get call.  For any further questions, please share the following details in a private message:
  1. Report id created in the UI
  2. DCM account id
  3. Profile id
You can share this information privately via the forum's 'Reply Privately to author' feature.

Thanks,
Lakshmi, DCM API Team

Reply all
Reply to author
Forward
0 new messages