Groups
Groups

RE: help needed with promotion asset editing in google ads api

102 views
Skip to first unread message

Google Ads API Forum Advisor

unread,
Jan 31, 2025, 9:19:32 AM1/31/25
to adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team.

Please be informed that I have removed your response from the forums as it contains the PII information.

From the provided information, you are able to update the DiscountModifier from Unspecified to UpTo by using Money Amount Off. When you are updating from Monetary Discount to Percent Discount you are facing errors for the promotion asset "197461829098". In order to assist further, kindly provide us with the complete API logs (request and response logs with request-id and request header) generated at your end with the combinations you are updating DiscountModifier, Money Amount Off, and Percent Off. 

If you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that you are using. You can refer to the guides Java.NetPHPPythonRuby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag. 

You can send the details via Reply privately to the author option, or direct private reply to this email.
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vGzT6:ref" (ADR-00286545)

Thanks,
 
Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5



Shahil Kumar

unread,
Feb 1, 2025, 11:52:32 AM2/1/25
to Google Ads API and AdWords API Forum

Hi,

I'm facing a issue when trying to edit promotion assets using the Google Ads API in C#.

Issues Encountered:
  1. Limited Updates: I can only update the DiscountModifier from Unspecified to UpTo when using Money Amount Off. For other cases like switching between Monetary Discount, Percent Discount, and combinations thereof, I keep encountering errors.
  2. API Response: Even when the API returns a success response, the DiscountModifier does not always get updated.
Conditions to Clarify:

Could you please list the required conditions for each of these cases when updating DiscountModifier, Money Amount Off, and Percent Off?

  1. From Monetary Discount to UpTo Monetary Discount (only DiscountModifier to UpTo needs to be updated)
  2. From Monetary Discount to Percent Discount
  3. From Monetary Discount to UpTo Percent Discount
  4. From UpTo Monetary Discount to Monetary Discount
  5. From UpTo Monetary Discount to Percent Discount
  6. From UpTo Monetary Discount to UpTo Percent Discount
    and other conditions too......

My Code: 
var promotionAsset = new PromotionAsset() { 
   Occasion = occasion,PromotionTarget = "toys" 
   promotionAsset.DiscountModifier = PromotionExtensionDiscountModifierEnum.Types.PromotionExtensionDiscountModifier.Unspecified; 
   promotionAsset.MoneyAmountOff = new Money() { AmountMicros = 50000L, CurrencyCode = "USD" };
var asset =  new Asset() { 
        Id = assetData["assetId"],
        PromotionAsset = promotionAsset, 
}
 
I'm using the code above to update the discount modifier. Is it possible to just send the new discount modifier and have it update only that, without affecting the rest? For example, if the asset already has MoneyAmountOff, it should stay the same. Could you also list all the conditions I mentioned earlier? That would be really helpful for me.  


Another issue is that I'm unable to fetch startDate and endDate using the following query:

SELECT campaign_asset.asset, campaign_asset.campaign, asset.type, metrics.clicks, metrics.cost_micros, metrics.conversions, asset.promotion_asset.discount_modifier, asset.promotion_asset.money_amount_off.amount_micros, asset.promotion_asset.money_amount_off.currency_code, asset.promotion_asset.orders_over_amount.amount_micros, asset.promotion_asset.orders_over_amount.currency_code, asset.promotion_asset.percent_off, asset.promotion_asset.promotion_target, asset.promotion_asset.occasion, asset.promotion_asset.start_date, asset.promotion_asset.end_date, asset.promotion_asset.promotion_code FROM campaign_asset WHERE campaign_asset.campaign = 'customers/4973912890/campaigns/22149701508' AND campaign_asset.status = ENABLED AND asset.type = PROMOTION AND segments.date BETWEEN '2024-01-01' AND '2025-01-30';

I am able to get other data like asset type and other metrics of the asset but it always returns the empty string for start Date and endDate. 
Please provide guidance on the conditions and help with fetching startDate and endDate.

Thanks in advance!

Reply all
Reply to author
Forward

Shahil Kumar

unread,
Feb 1, 2025, 12:20:49 PM2/1/25
to Google Ads API and AdWords API Forum
Here is the full logs and the errors - 

 When my promotion asset discount modifier is set to Upto 3%. And I want to change its discount Modifier to Monetary Discount (  PromotionExtensionDiscountModifier.Unspecified ) 



var promotionAsset = new PromotionAsset() { 
   Occasion = occasion,PromotionTarget = "toys" 
   promotionAsset.DiscountModifier = PromotionExtensionDiscountModifierEnum.Types.PromotionExtensionDiscountModifier.Unspecified; 
   promotionAsset.MoneyAmountOff = new Money() { AmountMicros = 50000L, CurrencyCode = "USD" };
var asset =  new Asset() { 
        Id = assetData["assetId"],
        PromotionAsset = promotionAsset, 
}

Error - { "assetError": "PROMOTION_CANNOT_SET_PERCENT_OFF_AND_MONEY_AMOUNT_OFF" 

Here are some other cases - 
  1. It works fine when I update the discount modifier from one percent discount to another.

  2. When I try to change "Upto PercentOff" to "Unspecified PercentOff," the API gives a successful response, but the value doesn't actually change. It still shows "Upto PercentOff." value of Discount Modifier.

  3. If I try to set the discount modifier to "Unknown," the API returns an error saying it's an invalid enum value. When fetching data for assets with monetary discounts, it shows the discount modifier as "Unknown," not "Unspecified."

  4. When the discount modifier is set to a monetary discount and the amount is $5:

    • If I try updating it to "Unspecified" with "Percent Off," I get an error: PROMOTION_CANNOT_SET_PERCENT_OFF_AND_MONEY_AMOUNT_OFF.
    • If I set MoneyAmountOff as { AmountMicros = -1, CurrencyCode = "" }, it updates the discount type to "Money Amount Off" but throws an error saying the amount is too short, even though I also sent a percent-off value (TOO_SHORT).

Because of these issues, I can't successfully update the discount modifier. Could you please help and list all conditions needed to handle each case properly?

Google Ads API Forum Advisor

unread,
Feb 3, 2025, 12:32:19 AM2/3/25
to adwor...@googlegroups.com

Hi,

Thank you for providing the logs, it seems like those are not complete logs. Please provide us with the complete API logs (request and response logs with request-id and request header) generated at your end to better assist you further.



You can send the details via Reply privately to the author option, or direct private reply to this email.

Reply all
Reply to author
Forward
Message has been deleted
0 new messages
Search
Clear search
Close search
Google apps
Main menu