Addind DMA as location via REST

59 views
Skip to first unread message

Matan Peleg

unread,
May 8, 2022, 5:00:48 AM5/8/22
to Google Ads API and AdWords API Forum
hola,
I understand that in order to add location targeting to a campaign I need to add criteria 
via campaignCriteria.
Is it done via the geoTargetConstant? 
I need to add locations by DMA value. does every DMA have criterion_id? if so, how do know what that id is?
can I add multiple DMAs as an array?
Please mind that I'm using REST, not a client library.

Thanks

Google Ads API Forum Advisor

unread,
May 10, 2022, 11:28:36 AM5/10/22
to adwor...@googlegroups.com
Hi Matan,

The  geo_target_constant report lists DMA Regions, while we don't have a CSV file of DMA regions

Here's a sample REST DMA location criteria creation as an array of operations, I just used this in my test account:
curl -i --request POST https://googleads.googleapis.com/v10/customers/<OPERATING_CUSTOMER_PLACEHOLDER>/campaignCriteria:mutate \
--header "Content-Type: application/json" \
--header "login-customer-id: <LOGIN_CUSTOMER_ID_PLACEHOLDER>" \
--header "developer-token: <DEVELOPER_TOKEN_PLACEHOLDER>" \
--header "Authorization: Bearer <ACCESS_TOKEN_PLACEHOLDER>" \

--data '{
    "operations": [
          { 
                    "create": {
"campaign": "customers/<OPERATING_CUSTOMER_PLACEHOLDER>/campaigns/16252085032",
"location": {
                "geoTargetConstant": "geoTargetConstants/200501",
          },
           },
},
 {
          "create": {
"campaign": "customers/<OPERATING_CUSTOMER_PLACEHOLDER>/campaigns/16252085032",
"location": {
                "geoTargetConstant":"geoTargetConstants/200531",
          },
           },
},

    ],
"responseContentType": "MUTABLE_RESOURCE"
}
'

Regards,

Google Logo
Aryeh
Google Ads API Team
 


ref:_00D1U1174p._5004Q2aqnA4:ref

Matan Peleg

unread,
May 10, 2022, 12:00:57 PM5/10/22
to Google Ads API and AdWords API Forum
THANK YOU Aryeh!
Reply all
Reply to author
Forward
0 new messages