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? On Saturday, February 1, 2025 at 10:22:32 PM UTC+5:30 Shahil Kumar wrote: > 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 > > > > > > > > > > > > > > > > > > On Friday, January 31, 2025 at 7:49:32 PM UTC+5:30 Google Ads API Forum > Advisor wrote: > >> 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 >> <https://developers.google.com/google-ads/api/docs/concepts/field-service#request> >> and response >> <https://developers.google.com/google-ads/api/docs/concepts/field-service#response> >> logs >> with request-id >> <https://developers.google.com/google-ads/api/docs/concepts/call-structure#request-id> >> and request header >> <https://developers.google.com/google-ads/api/docs/concepts/call-structure#request_headers>) >> >> 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 >> <https://developers.google.com/google-ads/api/docs/client-libs/java/logging> >> , .Net >> <https://developers.google.com/google-ads/api/docs/client-libs/dotnet/logging> >> , PHP >> <https://developers.google.com/google-ads/api/docs/client-libs/php/logging> >> , Python >> <https://developers.google.com/google-ads/api/docs/client-libs/python/logging> >> , Ruby >> <https://developers.google.com/google-ads/api/docs/client-libs/ruby/logging> >> or Perl >> <https://developers.google.com/google-ads/api/docs/client-libs/perl/logging> >> 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, >> >> [image: Google Logo] Google Ads API Team >> Feedback >> How was our support today? >> >> [image: rating1] >> <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/viewform?usp=pp_url&entry.141427034=1&entry.295079254=5004Q00002vGzT6QAK> >> >> [image: rating2] >> <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/viewform?usp=pp_url&entry.141427034=2&entry.295079254=5004Q00002vGzT6QAK> >> >> [image: rating3] >> <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/viewform?usp=pp_url&entry.141427034=3&entry.295079254=5004Q00002vGzT6QAK> >> >> [image: rating4] >> <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/formResponse?usp=pp_url&entry.141427034=4&entry.295079254=5004Q00002vGzT6QAK> >> >> [image: rating5] >> <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/formResponse?usp=pp_url&entry.141427034=5&entry.295079254=5004Q00002vGzT6QAK> >> >> >> -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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 adwords-api@googlegroups.com To unsubscribe from this group, send email to adwords-api+unsubscr...@googlegroups.com 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 "Google Ads API and AdWords API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/adwords-api/8744b1ce-8729-4580-9b21-071058abc48fn%40googlegroups.com.