Skip to content

draft_update_conversion_action: add category, refuse include_in_conversions_metric - #122

Open
illia-sapryga wants to merge 1 commit into
kLOsk:mainfrom
illia-sapryga:feat/conversion-action-category
Open

illia-sapryga wants to merge 1 commit into
kLOsk:mainfrom
illia-sapryga:feat/conversion-action-category

Conversation

@illia-sapryga

Copy link
Copy Markdown
Contributor

Two related changes to one tool.

The docstring says include_in_conversions_metric is mutable on update. It isn't. On a real account Google answered IMMUTABLE_FIELD at apply, after the validate-only dry run had passed, so the preview and the dry run both looked fine and only the real apply failed. Google derives the value from primary_for_goal and whether the goal of the action's category is biddable. The draft now refuses the parameter and names those two instead. I kept the parameter so a caller gets that message and not a schema error. A plan already stored with the field raises at apply and sends nothing. The create tool's docs pointed at the update tool for this, so I corrected those too.

That leaves a gap: an action in a category whose goal isn't biddable has no way to start counting through AdLoop. category closes it by moving the action to another goal, for example DEFAULT to PHONE_CALL_LEAD. The preview shows current_category and warns that campaigns bidding on those goals can start or stop optimizing toward it. The same category, a removed action and an unknown ID are refused at draft time.

What it does not do: it doesn't change primary_for_goal, and it doesn't check whether the target goal is biddable, so the warning says "only if". There is no re-check of the category at apply; the tool's other fields have none either. I left the rules file alone because these tools aren't listed there and the refusal message explains itself.

Tested with the full suite. test_include_in_conversions_metric_is_mutable_on_update and test_update_include_in_conversions_metric_fieldmask asserted the old behaviour and are replaced by tests of the refusal. The category path runs through confirm_and_apply(dry_run=True) with real protos, the real validate-only wrapper and a fake service, and GAQL is stubbed. I saw the IMMUTABLE_FIELD answer on a live account, but this code has not been run against one, and validate-only is known not to catch that particular error, so a green dry run says little about real updates to this tool.

…rsions_metric

category moves the action to another goal; the preview shows the current one.

include_in_conversions_metric was documented as mutable on update. Google
answers IMMUTABLE_FIELD at the real apply and validate_only does not catch it,
so the draft now refuses it and names primary_for_goal and category instead.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant