Cannot pass location Id for linking GMB specific locations while creating Campaign

336 views
Skip to first unread message

Megha Sethi

unread,
Mar 10, 2021, 8:06:33 AM3/10/21
to AdWords API and Google Ads API Forum
Hi,

As per the documentation - There is option to set GMB as ENUM -> 
Set the local_campaign_setting to an LocalCampaignSetting object with: 
location_source_type set to either GOOGLE_MY_BUSINESS to use the locations in your linked Google My Business account, or AFFILIATE to use the affiliate location extensions in your Google Ads account.

How Can we pass location Ids of GMB to link specific locations while creating campaign using API ?


Google Ads API Forum Advisor Prod

unread,
Mar 10, 2021, 10:07:18 PM3/10/21
to megha...@momos.io, adwor...@googlegroups.com

Hello there,

Thanks for raising this to us.

As per this documentation (Local campaign), when setting the location_source_type, you can either choose between GOOGLE_MY_BUSINESS or AFFILIATE.

  • When using the GOOGLE_MY_BUSINESS, locations that are setup on your GMB account are automatically linked. However, if you would want to create those locations on your GMB account, then you check on this guide or refer to this sample (Create a new location extensions feed linked to your GMB account)
  • When using the AFFILIATE, you can check on this guide (creating Affiliate Location extensions) instead.

Hope this helps.

Regards,

Google Logo
Mark Kevin Albios
Google Ads API Team
 

 

ref:_00D1U1174p._5004Q2DuHqg:ref

Megha Sethi

unread,
Mar 12, 2021, 12:57:20 AM3/12/21
to Google Ads API Forum Advisor Prod, adwor...@googlegroups.com
Hi there,

I am focusing on using location_source_type as GOOGLE_MY_BUSINESS for my project. 
But my question is, Is there any way where we can select and pass specific locations of GMB to get linked with a particular campaign, not all ?

Regards,
Megha

Megha Sethi

unread,
Mar 14, 2021, 12:44:14 AM3/14/21
to AdWords API and Google Ads API Forum
Is there any update on this ?

Google Ads API Forum Advisor Prod

unread,
Mar 15, 2021, 10:32:08 AM3/15/21
to megha...@momos.io, adwor...@googlegroups.com

Hi Megha,

Thank you for reaching out. I work with Mark. You could create CampaignFeed or AdGroupFeed objects if you want fine-grained control over which locations appear in the ads for each campaign or ad group.

Thanks and regards,
Xiaoming, Google Ads API Team
 


Google Logo
Xiaoming
Google Ads API Team
 


ref:_00D1U1174p._5004Q2DuHqg:ref

Megha Sethi

unread,
Mar 15, 2021, 12:31:12 PM3/15/21
to AdWords API and Google Ads API Forum
Thanks for your reply.

Is that not the thing where we can say when creating an ad or campaign we can pass specific location id where in we can define these are the GMB locations for which we have to create Ad from API? 
Because From Dashboard, i guess there is option available when we create Campaign.

Also, links you refer are of Adwords documentation which is going to deprecate soon. Do we have official doc of Google Ads Documentation ?

Thanks

Google Ads API Forum Advisor Prod

unread,
Mar 15, 2021, 3:55:00 PM3/15/21
to megha...@momos.io, adwor...@googlegroups.com

Hi Megha,

Thank you for reaching out. Geo targeting campaigns for a region is different from the GMB locations linking. You could create CampaignFeed or AdGroupFeed objects if you want fine-grained control over which locations appear in the ads for each campaign or ad group.



Thanks and regards,
Xiaoming, Google Ads API Team

 

Megha Sethi

unread,
Mar 17, 2021, 5:39:06 AM3/17/21
to AdWords API and Google Ads API Forum
So, What i understand is for linking ad to show for specific location, I may need to create Feed on Ad Group or Campaign level.
But before that i need to create a Feed object , right ?

Also when creating feed object , what is this business account id and how to pass it ?
Is it not the GMB location id ?

Megha Sethi

unread,
Mar 17, 2021, 9:35:17 AM3/17/21
to AdWords API and Google Ads API Forum
I am able to create Feed Object and as per documentation, Google Ads by default set Feed attributes and feed mapping between Google Ads and GMB.
But how we need to make sure from API level that Feed Mapping is actually done because we are creating manually feedmapping and we don't have resource name to check using GET API.

Along with this, please answer these questions as well -
1. When we don't create any feed/location extension, if we just create campaign/adgroup/ad by passing ENUM as GMB at campaign level. BY default it takes all businesses of GMB to show ads right ?
2. If we create Feed Object only , will it be applicable to all campaigns /ads we create ? 
3.  Is it mandatory to associate it with customer ? If i create Feed on managerial level -> it automatically associate with each customers. On the other hand, if i try to create Feed for sub accounts under that manager -> it automatically associate with each customers. So why is it necessary to associate with Customer ?
4.  Is it mandatory to associate it with campaign or adgroup feed? If we have created Feed with given business account id then why is there need to associate with campaigns / ad group feeds. I assume it is applicable to all.
5. What is concept of Feed Items? Do we need to create it manually after creating Feed?
6. Can we pass specific location ids (from the business that we added to manage in Feed), when we associate Feed with Campaign or Ad Group ?

Please reply urgent.

Thanks

Google Ads API Forum Advisor Prod

unread,
Mar 18, 2021, 5:02:40 AM3/18/21
to megha...@momos.io, adwor...@googlegroups.com
Hi Megha,

Thank you for your questions. You may refer below for my responses :


I am able to create Feed Object and as per documentation, Google Ads by default set Feed attributes and feed mapping between Google Ads and GMB.
But how we need to make sure from API level that Feed Mapping is actually done because we are creating manually feedmapping and we don't have resource name to check using GET API.


Feed mapping should be automatically done by the system as mentioned here.


1. When we don't create any feed/location extension, if we just create campaign/adgroup/ad by passing ENUM as GMB at campaign level. BY default it takes all businesses of GMB to show ads right ?

This approach unfortunately would not work, you would need to follow the guides in order for your GMB locations to work as intended.


2. If we create Feed Object only , will it be applicable to all campaigns /ads we create ? 

Once the feed is created and setup accordingly, the system should automatically create the attributes. You will then have the option to associate it at the customer/campaign/adgroup level. These however, cannot be associated directly to ads. For more information related to this question, you may refer to this section once more.


3.  Is it mandatory to associate it with customer ? If i create Feed on managerial level -> it automatically associate with each customers. On the other hand, if i try to create Feed for sub accounts under that manager -> it automatically associate with each customers. So why is it necessary to associate with Customer ?

4.  Is it mandatory to associate it with campaign or adgroup feed? If we have created Feed with given business account id then why is there need to associate with campaigns / ad group feeds. I assume it is applicable to all.

5. What is concept of Feed Items? Do we need to create it manually after creating Feed?

For the above #3, #4 and #5 items, I would recommend reaching out to the Google Ads Product support team, via this link, for further insight on location extension concepts and behavior when set at specific levels.


6. Can we pass specific location ids (from the business that we added to manage in Feed), when we associate Feed with Campaign or Ad Group ?

This is unfortunately not possible via the Google Ads API. You can refer to the below guides for more options in managing your location extensions :

Feed Item Set
Filtering Location Extensions

Best regards,

Google Logo
Peter Laurence Napa Oliquino
Google Ads API Team
 


ref:_00D1U1174p._5004Q2DuHqg:ref

Megha Sethi

unread,
Mar 19, 2021, 6:04:06 AM3/19/21
to AdWords API and Google Ads API Forum
Thanks Got it.

I have created one Flow for Adding Location extensions for new google ads account for linking it with GMB -> 
1. Create a Feed by passing business account id and origin as GOOGLE. So it automatically creates all attributes, feed items and feed mapping.
2. Associate this feed with customer by passing placeholder types as LOCATION.
3. Create a Local Campaign -> Ad group -> Local Ad.
4. I try to Associate Feed with Campaign Feed but it throws an error of Matching function would not be allowed for this placeholder type. I don't understand WHY? Can you please answer it ?
5. Then i try to associate Feed with Adgroup feed and it created successfully for granular filtering of locations with specific ads.

Please answer these questions ->

1. The flow that i created for Adding Location extension to google ads account and then associating specific locations to ad level. Is this correct or am i missing something ?
2. Please tell me more about Point no. #4 i mentioned above in the flow

3. I provide matching function  ->
matching_function: {
function_string: 'IDENTITY(true)',
left_operands: [{ constant_operand: { boolean_value: true } }],
operator: 'IDENTITY'
 },
for associating with customer . Is that right ?

4. On Adgroup level Feed, i have passed this as matching function -
matching_function: {
function_string: 'IN(FEED_ITEM_ID,{167953491297})',
left_operands: [{ request_context_operand: { context_type: 2 } }],
operator: 2,
right_operands: [
{ constant_operand: { long_value: 167953491297 } }
],
},
Is there any other way we can check with location name OR location id. How do we match in case of Virtual brand when we have same location names?  Do we have to keep this mapping of location id with feed item id for filtering specific locations

5. When we create Feed, we can pass business account id of GMB - Can we pass multiple account ids in case we have two brands on GMB and we want all locations to be added for Google ads account. AS of now, i can see it is taking only a string. Is there any way to pass multiple. If yes, can you please give example ?

Thanks

Megha Sethi

unread,
Mar 19, 2021, 11:31:04 AM3/19/21
to AdWords API and Google Ads API Forum
Adgroup Feed Matching function -> 

I am trying to create this matching function in case of i want to combine functions using AND

matching_function: {
function_string: `AND(CONTAINS_ANY(FeedAttribute[${feedId},1],{"name of business"}),CONTAINS_ANY(FeedAttribute[${feedId},9],{"Pub"}))`,
left_operands: [
{
matching_function: {
function_string: `CONTAINS_ANY(FeedAttribute[${feedId},1],{"name of business"})`,
left_operands: [{feed_attribute_operand: { feed_id: feedId, feed_attribute_id: 1}}],
operator: CONTAINS_ANY,
right_operands: [
{ constant_operand: { string_value: "name of business" } }
]
},
},
{
matching_function: {
function_string: `CONTAINS_ANY(FeedAttribute[${feedId},9],{"Pub"})`,
left_operands: [{feed_attribute_operand: { feed_id: feedId, feed_attribute_id: 9}}],
operator: CONTAINS_ANY,
right_operands: [
{ constant_operand: { string_value: "Pub" } }
]
}
}
],
operator: AND
}

If i try to create separate matching functions to associate with Ad group feed, it is working but if i am combining functions- it is giving me Internal server error.

Please let me know what i am doing wrong here

Thanks

Google Ads API Forum Advisor Prod

unread,
Mar 22, 2021, 4:45:22 AM3/22/21
to megha...@momos.io, adwor...@googlegroups.com
Hi Megha,

I am also a member of Google Ads API / AdWords API team and let me provide support to your concern.

Please see my response below for each of your question:


"I try to Associate Feed with Campaign Feed but it throws an error of Matching function would not be allowed for this placeholder type. I don't understand WHY? Can you please answer it ?"
"Please tell me more about Point no. #4 i mentioned above in the flow"
- Could you provide the complete request and response logs with request ID generated on your end where we can see the error to investigate?


"The flow that i created for Adding Location extension to google ads account and then associating specific locations to ad level. Is this correct or am i missing something ?"
-I am afraid that this is not possible as according to this document, you can override the default behavior by applying location extensions to a specific ad group or campaign through filters, ad is not included here.

"I provide matching function.... associating with customer . Is that right ?"
This is correct as based on this guide, the CustomerFeed with location extensions only supports a true IDENTITY function or a platform function; no other matching functions will be accepted.


"Is there any other way we can check with location name OR location id. How do we match in case of Virtual brand when we have same location names?  Do we have to keep this mapping of location id with feed item id for filtering specific locations"
- I am afraid that there is no other way to filter the feed with location name OR location id as the only available Function types are listed on this document.


"5. When we create Feed, we can pass business account id of GMB - Can we pass multiple account ids in case we have two brands on GMB and we want all locations to be added for Google ads account. AS of now, i can see it is taking only a string. Is there any way to pass multiple. If yes, can you please give example ?"
-I am afraid that this is not possible also as your Google Ads account can have only one ENABLED feed linked to a Google My Business account on the first place. Please see the Key point section of this document to read more information about this.


"If i try to create separate matching functions to associate with Ad group feed, it is working but if i am combining functions- it is giving me Internal server error."
- Could you also provide the complete request and response logs with request ID generated when associating matching function with Ad group feed that encountered error to investigate?

Regards,
Google Logo
Ernie John Blanca Tacata
Google Ads API Team
 


ref:_00D1U1174p._5004Q2DuHqg:ref

Megha Sethi

unread,
Mar 26, 2021, 1:28:01 AM3/26/21
to AdWords API and Google Ads API Forum
Hi,

I am trying to filter Location on Adgroup feed level using Feed Item Ids using IN(FEED_ITEM_ID,{1,2,3})

1. I am passing 3 item ids from which 2 are correct and 1 is wrong. But still it is showing in settings as 3 Locations selected. What does it mean ?
Will it show correct locations only when we ad will run ?
See attached screenshot.

2. As, am using AdGroup Feed to filter out locations for specific Ad 
https://developers.google.com/google-ads/api/reference/rpc/v6/AdGroupFeed
Does it shows in Campaign Settings as per attached screenshot.

Thanks

Screenshot 2021-03-26 at 10.56.02 AM.png

Google Ads API Forum Advisor Prod

unread,
Mar 26, 2021, 1:01:35 PM3/26/21
to megha...@momos.io, adwor...@googlegroups.com

Hi Megha,

Thank you for reaching out. Please find my response to your questions below:

  1. If the item_id is wrong, you would need to correct it before the ads run.
 
  1. It will not show on the Campaign Settings page. Please go into the specific ad group and check the Ad Group Settings page for the location information.
 

Thanks and regards,
Xiaoming, Google Ads API Team

 

Google Logo
Xiaoming
Google Ads API Team
 


ref:_00D1U1174p._5004Q2DuHqg:ref

Megha Sethi

unread,
Mar 27, 2021, 3:53:45 AM3/27/21
to AdWords API and Google Ads API Forum
Hi,

In response to your answers -

1. Why does it take the wrong item ids in the API and does not give any error.
2. Nothing is showing in the Ad group setting page except this. See in screenshot below.

Thanks
Screenshot 2021-03-27 at 1.22.13 PM.png

Google Ads API Forum Advisor Prod

unread,
Mar 28, 2021, 10:39:46 PM3/28/21
to megha...@momos.io, adwor...@googlegroups.com
Hi Megha,

To further investigate, could you provide the following details via Reply privately to author option for the issues that you've mentioned:
  • Customer ID
  • Complete request and response logs with request ID generated on your end for each issue that you mentioned

Regards,
Google Logo
Ernie John Blanca Tacata
Google Ads API Team
 


ref:_00D1U1174p._5004Q2DuHqg:ref
Reply all
Reply to author
Forward
0 new messages