Create the missing goals of a counter
direct_metrika_goalsCreates missing Yandex Metrika JavaScript-event goals in a counter, checking existing event identifiers first. Existing goals stay unchanged, and a read-back verifies each creation.
Instructions
Create JavaScript-event goals in one Metrika counter, idempotently: what the counter already has is checked by the event identifier first, only the missing goals are created, and the existing ones are never changed and never deleted. After creating, the counter is read back ā a goal the read-back does not show is an error, not a footnote.
š“ Goals must exist BEFORE the first ad click: retroactive credit does not exist in Metrika, and a duplicate goal is worse than a missing one ā an autostrategy learns on doubled counts.
Called without a confirmation it answers a preview: ā already exists / + will be created. The confirmation phrase names the counter, so a write aimed at the wrong counter is caught at the moment of confirming.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| goals | Yes | objects with event (the identifier the site sends, verbatim) and name (what the goal is called in Metrika) | |
| counter | Yes | numeric counter id ā it appears in the confirmation phrase | |
| confirmation | No | the exact phrase the preview asks for |