Hi,

I'm facing a similar issue when trying to edit promotion assets using the 
Google Ads API in C#.
Issues Encountered: 
   
   1. *PercentOff Field:* Since PercentOff is of type long, it cannot be 
   set to -1 or null. Its default value is always 0. 
   2. *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. 
   3. *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* 

My Code: var promotionAsset = new PromotionAsset() { Occasion = 
Enum.TryParse(assetData.GetValueOrDefault("occasion")?.ToString(), out 
PromotionExtensionOccasionEnum.Types.PromotionExtensionOccasion occasion) ? 
occasion : 
PromotionExtensionOccasionEnum.Types.PromotionExtensionOccasion.Unspecified, 
PromotionTarget = 
assetData.GetValueOrDefault("promotionTarget")?.ToString() ?? string.Empty, 
}; promotionAsset.DiscountModifier = 
PromotionExtensionDiscountModifierEnum.Types.PromotionExtensionDiscountModifier.Unspecified;
 
promotionAsset.ClearPercentOff(); promotionAsset.MoneyAmountOff = new 
Money() { AmountMicros = 50000L, CurrencyCode = "USD" }; // 
promotionAsset.PercentOff = 500000L; return new Asset() { Id = 
assetData.ContainsKey("assetId") ? assetData["assetId"].ToLong() : 
-1000000000, PromotionAsset = promotionAsset, }; 

*Notes:*

   - Occasion and PromotionTarget updates work without issues. 
   - 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'; 

Please provide guidance on the conditions and help with fetching startDate 
and endDate.

Thanks in advance!

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/44f53138-cc7f-42d5-8e30-cfa11219b3e8n%40googlegroups.com.
  • He... 'Shahil Kumar' via Google Ads API and AdWords API Forum
    • ... 'Shahil Kumar' via Google Ads API and AdWords API Forum
      • ... 'Shahil Kumar' via Google Ads API and AdWords API Forum
        • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum

Reply via email to