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*
and other conditions too......
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!
On Saturday, October 3, 2020 at 3:02:53 AM UTC+5:30 Google Ads API Forum
Advisor Prod wrote:
> Hi Roman,
>
> Thank you for the feedback and clarifications. I was able to reproduce the
> issue and to fix it by setting the field "percentOff" to "-1" instead of
> "None".
>
> Could you give it a try on your side?
>
>
> Thanks,
> Pierrick - Google Ads API Team
>
> ref:_00D1U1174p._5004Q25Y07u:ref
>
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/adwords-api/29f78ef8-f0ef-4568-84fd-b28e7bbedcf3n%40googlegroups.com.