Creative Assignment Using CM360 Api

349 views
Skip to first unread message

Bartu Elgin

unread,
Jul 6, 2021, 9:42:46 AM7/6/21
to Google's Campaign Manager 360 API Forum
Hi CM360 API community,

I would like to now if its possible to assign creatives to Ads or Placements using api. Because its possible to create and assign Ad to placement.

Best Wishes,
Bartu

DCM API (DoubleClick Campaign Mgr)

unread,
Jul 7, 2021, 2:57:28 AM7/7/21
to google-doubleclick-...@googlegroups.com
Hi Bartu,

Thank you for reaching out to us.

Yes it is possible and you can do this by adding the creative details on the creative assignment of your Ad. You may check this docs for reference.

Regards,
Google Logo
Michael Angelo Legaspi
DCM API Team
 


ref:_00D1U1174p._5004Q2JYwbC:ref

Bartu Elgin

unread,
Jul 12, 2021, 7:56:24 AM7/12/21
to Google's Campaign Manager 360 API Forum
Hi Micheal,

I am using below script in  AppScript, but couldnt manage to assign creatives, Ad is getting assigned to placement using same method, but creative assisgnment isnt working. Couldnt figure out where im doing wrong .

function _createOneAd(ss, singleAdArray){
  var profileID = _fetchProfileId(hucre1);

  var campaignId = singleAdArray[0];
  var name = singleAdArray[1];

  var startTime = Utilities.formatDate(
      singleAdArray[2], ss.getSpreadsheetTimeZone(),
      'yyyy-MM-dd\'T\'HH:mm:ss.SSS\'Z\'');

  var endTime = Utilities.formatDate(
      singleAdArray[3], ss.getSpreadsheetTimeZone(),
      'yyyy-MM-dd\'T\'HH:mm:ss.SSS\'Z\'');

  var impressionRatio = singleAdArray[4];
  var priority = singleAdArray[5];
  var type = singleAdArray[6];
  var placementId = singleAdArray[7];
  var creativeId = singleAdArray[8];

  if(priority<10){
    priority = "0"+priority;
  }

  var adResource = {
      "kind": "dfareporting#ad",
      "campaignId":campaignId,
      "name": name,
      "startTime": startTime ,
      "endTime": endTime,
      "deliverySchedule":{
        "impressionRatio":impressionRatio,
        "priority":"AD_PRIORITY_"+priority
      },
      "type":type
    };

  adResource.placementAssignments = [{"placementId":placementId}];
  adResource.creativeAssignment = [{"creativeId":creativeId}];

  var newAd = DoubleClickCampaigns.Ads.insert(
    adResource, profileID);
  return newAd;
}





Best Wishes,
Bartu

DCM API (DoubleClick Campaign Mgr)

unread,
Jul 13, 2021, 3:52:47 AM7/13/21
to google-doubleclick-...@googlegroups.com

Hi Bartu,

 

I'm afraid we can only give precise solution in DCM API's perspective. However, let me give you an idea and you just might be able to get a hint where to tweak it. Creative assignments is an object under creative rotation, you cannot directly pass their field just like what you do in placement assignments.

 

You may refer again to this docs and check carefully where it is placed in request body.

Regards,

Message has been deleted

Bartu Elgin

unread,
Jul 13, 2021, 9:30:17 AM7/13/21
to Google's Campaign Manager 360 API Forum
Hi,

Yep it worked! . Creative Assignment should be done under Creative Rotation. I am placing sample code below to guide anyone requiring:

"creativeRotation":{
        "creativeAssignments":[{
            "active": true,
            "creativeId":creativeId,
            "clickThroughUrl": {"defaultLandingPage" : true}
          }
        ]
      },

In addition to this , if you are trying to assign creative to ad, ad to placement, in one step, you need to set "active":true , in placement assignment for ad. 


Best Wishes,
Bartu

DCM API (DoubleClick Campaign Mgr)

unread,
Jul 14, 2021, 12:29:07 AM7/14/21
to google-doubleclick-...@googlegroups.com

Hi Bartu,

 

Glad it worked! For your question regarding rotation status in using CM UI, I would recommend to reach out to our product support team as they have the specialist there that can assist you better regarding the matter.

Regards,

Reply all
Reply to author
Forward
0 new messages