示例#1
0
            'ns0:CustomParameters')
        parameters_2 = campaign_service.factory.create(
            'ns0:ArrayOfCustomParameter')
        custom_parameter_2 = campaign_service.factory.create(
            'ns0:CustomParameter')
        custom_parameter_2.Key = 'promoCode'
        custom_parameter_2.Value = 'updatedpromo'
        parameters_2.CustomParameter.append(custom_parameter_2)
        url_custom_parameters_2.Parameters = parameters_2
        expanded_text_ad_2.UrlCustomParameters = url_custom_parameters_2
        expanded_text_ad_2.Type = 'ExpandedText'
        update_ads.Ad.append(expanded_text_ad_2)

        # As an exercise you can step through using the debugger and view the results.

        campaign_service.GetAdsByAdGroupId(AdGroupId=ad_group_ids['long'][0],
                                           AdTypes=ALL_AD_TYPES)
        campaign_service.UpdateAds(AdGroupId=ad_group_ids['long'][0],
                                   Ads=update_ads)
        campaign_service.GetAdsByAdGroupId(AdGroupId=ad_group_ids['long'][0],
                                           AdTypes=ALL_AD_TYPES)

        update_keywords = campaign_service.factory.create('ArrayOfKeyword')
        update_keyword = set_elements_to_none(
            campaign_service.factory.create('Keyword'))
        update_keyword.Id = keyword_ids['long'][0]

        # You can set the Bid.Amount property to change the keyword level bid.
        update_keyword.Bid = campaign_service.factory.create('Bid')
        update_keyword.Bid.Amount = 0.46

        # When using the Campaign Management service with the Bing Ads Python SDK,
示例#2
0
            'ns0:CustomParameters')
        parameters_2 = campaign_service.factory.create(
            'ns0:ArrayOfCustomParameter')
        custom_parameter_2 = campaign_service.factory.create(
            'ns0:CustomParameter')
        custom_parameter_2.Key = 'promoCode'
        custom_parameter_2.Value = 'updatedpromo'
        parameters_2.CustomParameter.append(custom_parameter_2)
        url_custom_parameters_2.Parameters = parameters_2
        expanded_text_ad_2.UrlCustomParameters = url_custom_parameters_2
        expanded_text_ad_2.Type = 'Text'
        update_ads.Ad.append(expanded_text_ad_2)

        # As an exercise you can step through using the debugger and view the results.

        campaign_service.GetAdsByAdGroupId(AdGroupId=ad_group_ids['long'][0],
                                           AdTypes=None)
        campaign_service.UpdateAds(AdGroupId=ad_group_ids['long'][0],
                                   Ads=update_ads)
        campaign_service.GetAdsByAdGroupId(AdGroupId=ad_group_ids['long'][0],
                                           AdTypes=None)

        update_keywords = campaign_service.factory.create('ArrayOfKeyword')
        update_keyword = set_elements_to_none(
            campaign_service.factory.create('Keyword'))
        update_keyword.Id = keyword_ids['long'][0]

        # You can set the Bid.Amount property to change the keyword level bid.
        update_keyword.Bid = campaign_service.factory.create('Bid')
        update_keyword.Bid.Amount = 0.46

        # When using the Campaign Management service with the Bing Ads Python SDK,