AdGroupBidModifierOperation question

24 views
Skip to first unread message

Peter

unread,
Sep 12, 2016, 6:14:41 AM9/12/16
to AdWords API Forum
Hi,
I wonder if there are any issues with using 'operator':'ADD' for adgroups that have a bid already? Just trying to find an easy way to update all adgroups without distinguishing them by whether they have an adgroup-level mobile modifier already. The code I run at the moment is provided below but it only seem to update adgroups with existing bid modifier.

Thanks,
Peter



def BuildAdGroupMobileModifierOperations(adgroups):
    adgroup_operations = []
    for ag_id, ag_data in adgroups.iteritems():
        adgroup_operations.append(
            {
                'xsi_type': 'AdGroupBidModifierOperation',
                'operator': 'SET',
                'operand': {
                    'adGroupId': ag_id,
                    'criterion': {
                        'xsi_type': 'Platform',
                        'id': '30001' # Mobile criterion ID.
                    },
                    'bidModifier': ag_data['AdGroupMobileBidModifier']
                }
            }
        )

Vishal Vinayak (Adwords API Team)

unread,
Sep 12, 2016, 3:59:56 PM9/12/16
to AdWords API Forum
Hi Peter,

I would recommend fetching the source of the bid modifier using the field BidModifierSource in the selector of AdGroupBidModifierService. Once you identify the source, you can add a new one at the AdGroup level using the ADD operation or update the BidModifier using the SET operation, if a bid modifier already exists.

Regards,
Vishal, AdWords API Team
Reply all
Reply to author
Forward
0 new messages