Hi Xiaoming,
Thanks for getting back to me, I am currently working with python, would this
be a way of stating the customer_id for the header?
credentials = {
'developer_token': ‘XXXX’,
'refresh_token': 'XXXX',
'client_id': ‘XXXX’,
'client_secret': ‘XXXX',
'customer_id' : <master_mcc_no>}
client = GoogleAdsClient.load_from_dict(credentials)
What I am actually trying to do is that I want to update all bid modifiers for
Gender and Location across an account. I have been struggling quiet a bit, so
would appreciate if you could point me into a direction for that. First off, I
am trying to get the example for mobile devices to work, which so far has been
unsuccessful. I have been banging my head against the wall with this – so would
appreciate some input if you have any! 😊
Please see my attached code below
credentials = {
'developer_token': ‘XXXX’,
'refresh_token': 'XXXX ',
'client_id': ‘XXXX',
'client_secret': ‘XXXX',
'customer_id' : <master_mcc_no>}
client = GoogleAdsClient.load_from_dict(credentials)
customer_id = "XXXX"
campaign_id = "XXXX"
ad_group_id = "XXXX"
ad_group_service = client.get_service("AdGroupService", version="v6")
ad_group_bm_service = client.get_service(
"AdGroupBidModifierService", version="v6"
)
# Create ad group bid modifier for mobile devices with the specified ad
# group ID and bid modifier value.
ad_group_bid_modifier_operation = client.get_type(
"AdGroupBidModifierOperation"
)
ad_group_bid_modifier = ad_group_bid_modifier_operation.create
# Set the ad group.
ad_group_bid_modifier.ad_group = ad_group_service.ad_group_path(
customer_id, ad_group_id
)
# Set the bid modifier.
ad_group_bid_modifier.bid_modifier = 1.1
# Sets the device.
ad_group_bid_modifier.device.type = client.get_type(
"DeviceEnum", version="v6"
).MOBILE
# Add the ad group bid modifier.
ad_group_bm_response =
ad_group_bm_service.mutate_ad_group_bid_modifiers(customer_id,
[ad_group_bid_modifier_operation])
Best regards,
Albin
From: Google Ads API Forum Advisor Prod <[email protected]>
Sent: 12. februar 2021 21:30
To: Albin Adam Kristiansson <[email protected]>
Cc: [email protected]
Subject: RE: login_customer_id, cannot access resources further down the
hierarchy
Hi Albin,
Thank you for reaching out. I think you have misunderstood the two concepts
here. The login_customer_id has to be set in the configuration file and it
eventually will be used in the request header. For the resource, you have to
use the client customer id in the format of
customers/{customer_id}/adGroups/{ad_group_id} to trace down to the lowest
level entity. The client customer id could be set in a way such as in this
example<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_googleads_google-2Dads-2Djava_blob_master_google-2Dads-2Dexamples_src_main_java_com_google_ads_googleads_examples_basicoperations_GetAdGroups.java-23L109&d=DwMCaQ&c=N-xPqDyeLJg5V3gLll2thA&r=Tpl5Ld2zi1fCrxHu-AwtAVsiaqBwYN8vD5NBeqyq7hE&m=i8jLeItTW3kd_HzLi_ArSWwfCC6XgduIVYiGaxXbj5c&s=-DPumwq6o33lFFaSP7LonLC4W7rcDTARxxWbSW9wqcA&e=>.
Thanks and regards,
Xiaoming, Google Ads API Team
[Google Logo]
Xiaoming
Google Ads API Team
ref:_00D1U1174p._5004Q2CQKJZ:ref
Privileged/Confidential Information may be contained in this message. If you
are
not the addressee indicated in this message (or responsible for delivery of the
message to such person), you may not copy or deliver this message to anyone. In
such case, you should destroy this message and kindly notify the sender by
reply
email. Please advise immediately if you or your employer does not consent to
email
for messages of this kind. Opinions, conclusions and other information in this
message that do not relate to the official business of Group M Worldwide LLC
and/or
other members of the GroupM group of companies shall be understood as neither
given
nor endorsed by it. GroupM is the global media investment management arm of WPP.
For more information on our business ethical standards and Corporate
Responsibility
policies please refer to WPP's website at http://www.wpp.com/WPP/About/
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/DB6PR06MB413488151F89B10E5B32F481F1889%40DB6PR06MB4134.eurprd06.prod.outlook.com.