How to Unassign ads from Edit Ad assignments for placement page via API

93 views
Skip to first unread message

Analytics Prod

unread,
Sep 28, 2021, 7:25:17 AM9/28/21
to Google's Campaign Manager 360 API Forum
Hi,

Can someone help me out to unassign ads from Placements -> Edit Ad Assignments for Placement page. I could not see any valid endpoint to make the update. I am trying to assign the ads through API.

I have Tried the below endpoint, but I could not edit the Ads - 
/dfareporting/v3.5/userprofiles/{profileId}/ads




screenshot.png

DCM API (DoubleClick Campaign Mgr)

unread,
Sep 29, 2021, 1:46:23 AM9/29/21
to analytics-r...@canvasww.com, google-doubleclick-...@googlegroups.com

Hi Analytics Prod,

 

Thank you for reaching out to us.

 

You can edit the ads properties using the ads.update method. Then, in placementAssignments field, you may remove the current details and/or replace it with the one you would prefer.

Regards,

Google Logo
Michael Angelo Legaspi
DCM API Team
 


ref:_00D1U1174p._5004Q2OUk8B:ref

Analytics Prod

unread,
Sep 29, 2021, 6:01:25 AM9/29/21
to Google's Campaign Manager 360 API Forum
Thank you for the response. How can I check whether the ads is assigned or unassigned using  ads.update or is there any separate endpoint for checking the status?. I can see the  placementAssignments field in response. But how can I check and which field do I need to refer whether the Ads is in Assigned or Unassigned state. Please refer the response and screenshot attachment.

Using ads.get I can able to get the ads details, which field do I need to refer whether it is in assigned/unassigned state?.


Response:

{
    "kind": "dfareporting#ad",
    "id": "428132854",
    "idDimensionValue": {
        "kind": "dfareporting#dimensionValue",
        "etag": "\"5Wm9zsBzBcAvfv1Z_i0w2KuYtv8\"",
        "dimensionName": "adId",
        "value": "428132854"
    },
    "campaignId": "21618492",
    "campaignIdDimensionValue": {
        "kind": "dfareporting#dimensionValue",
        "etag": "\"jt3Fqsp4xmsQ7Oai0zdRTwazEJU\"",
        "dimensionName": "campaignId",
        "value": "21618492"
    },
    "advertiserId": "8109070",
    "advertiserIdDimensionValue": {
        "kind": "dfareporting#dimensionValue",
        "etag": "\"_laGfrshoHdI19aiE6wUE4DcVkE\"",
        "dimensionName": "advertiserId",
        "value": "8109070"
    },
    "accountId": "710848",
    "name": "Tracking Creative_1x1-DV_9.27.18",
    "active": true,
    "archived": false,
    "startTime": "2018-09-27T04:00:27.000Z",
    "endTime": "2019-01-01T04:59:59.000Z",
    "placementAssignments": [
        {
            "placementId": "227516758",
            "placementIdDimensionValue": {
                "kind": "dfareporting#dimensionValue",
                "etag": "\"P4hHVZLilHypI9_iYAX0Vemv-1k\"",
                "dimensionName": "placementId",
                "value": "227516758"
            },
            "active": true,
            "sslRequired": true
        }
    ],
    "clickThroughUrlSuffixProperties": {
        "overrideInheritedSuffix": false
    },
    "defaultClickThroughEventTagProperties": {
        "overrideInheritedEventTag": false
    },
    "createInfo": {
        "time": "1538072807159"
    },
    "lastModifiedInfo": {
        "time": "1538072831001"
    },
    "sslRequired": true,
    "sslCompliant": true,
    "type": "AD_SERVING_TRACKING",
    "deliverySchedule": {
        "hardCutoff": false,
        "priority": "AD_PRIORITY_15",
        "impressionRatio": "1"
    },
    "creativeRotation": {
        "type": "CREATIVE_ROTATION_TYPE_RANDOM",
        "weightCalculationStrategy": "WEIGHT_STRATEGY_EQUAL",
        "creativeAssignments": [
            {
                "creativeId": "105330253",
                "creativeIdDimensionValue": {
                    "kind": "dfareporting#dimensionValue",
                    "etag": "\"I9_yDFnj77zWqh_c6ynLz7Riqs4\"",
                    "dimensionName": "creativeId",
                    "value": "105330253"
                },
                "active": true,
                "clickThroughUrl": {
                    "defaultLandingPage": true,
                    "computedClickThroughUrl": "https://onesight.org/join-us"
                },
                "applyEventTags": true,
                "sslCompliant": true
            }
        ]
    }
}
screenshot.png

DCM API (DoubleClick Campaign Mgr)

unread,
Sep 30, 2021, 1:18:13 AM9/30/21
to analytics-r...@canvasww.com, google-doubleclick-...@googlegroups.com

Hi Analytics Prod,

 

Thank you for responding back to us.

 

You may check the placementAssignments field to see on what placement your ads was assigned to. If this field is not available when you pull your ads details using ads.get or ads.list, then it means the ads is unassigned to any placement. You may then use the ads.update method to assign it to whichever placement you prefer.

Analytics Prod

unread,
Sep 30, 2021, 3:33:03 AM9/30/21
to Google's Campaign Manager 360 API Forum
Thank you, it works fine. One last question, what is the date format we should give to make changes. I tried to make update service with date format as 2021-08-15 06:04:00 . But it throws invalid date format. What is the actual date format we should use?. I am trying to convert the fetched startTime and endTime using the .net command DateTime.Parse(item("startTime").ToString).ToString("yyyy-MM-dd hh:mm:ss"). What am I missing here?


Update Body:

"{ 'id': '503704097', 'campaignId': '26283944', 'advertiserId': '11194196', 'accountId': '710848', 'name': 'Iopex_Testing_Adname', 'active': false, 'archived': false, 'startTime': '2021-08-15 06:04:00', 'endTime': '2021-09-01 04:59:00', 'deliverySchedule': { 'hardCutoff': false, 'priority': 'AD_PRIORITY_15', 'impressionRatio': '1' } }"


Response:

@"{
  ""error"": {
    ""code"": 400,
    ""message"": ""Invalid value for: Invalid format: \""2021-08-15 06:04:00\"" is malformed at \"" 06:04:00\"""",
    ""errors"": [
      {
        ""message"": ""Invalid value for: Invalid format: \""2021-08-15 06:04:00\"" is malformed at \"" 06:04:00\"""",
        ""domain"": ""global"",
        ""reason"": ""invalid""
      }
    ]
  }
}
"

DCM API (DoubleClick Campaign Mgr)

unread,
Sep 30, 2021, 6:15:31 AM9/30/21
to analytics-r...@canvasww.com, google-doubleclick-...@googlegroups.com

Hi Analytics Prod,

 

Glad that it worked!

 

With regards to date format, I believe this should be just a simple string. However, I do notice that the startTime you are entering might be the cause of the issue, please be informed that this field must be a time in the future, while the endTime must be at least later than the startTime.

 

On the other hand, you may also try to list all of your ads using ads.list and see the format for the date that was inserted successfully.

Reply all
Reply to author
Forward
0 new messages