Feature Description
Originally submitted by Kelvin here - https://app.asana.com/1/8468971550303/project/1215795095553989/task/1216170547125582
For Optin monster, the campaign ID appears as the tab name: Form #jnpfwoygltxurnayflew
Shouldn't it be the campaign name instead? It might be more meaningful.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- When a Site Goals lead-generation breakdown tab represents an OptinMonster campaign, the tab should display the campaign's name instead of its ID (e.g. the campaign name rather than Form #jnpfwoygltxurnayflew).
- When the campaign cannot be resolved (e.g. it no longer exists on the site), the existing ID-based fallback label continues to be shown.
Implementation Brief
Test Coverage
- Extend
tests/phpunit/integration/Modules/Analytics_4/Datapoints/Get_Form_MetadataTest.php: an omapi campaign resolves its title by slug; an unknown slug resolves to null so the fallback applies; a non-omapi post sharing the same slug is not disclosed; and a draft campaign case matching whichever status decision is taken above.
- Extend the JS coverage in site-goals-breakdown /
LeadGenerationPerformanceWidget tests with a non-numeric (string) form ID resolving to a title - today's cases only exercise numeric IDs.
QA Brief
Changelog entry
Feature Description
Originally submitted by Kelvin here - https://app.asana.com/1/8468971550303/project/1215795095553989/task/1216170547125582
For Optin monster, the campaign ID appears as the tab name: Form #jnpfwoygltxurnayflew
Shouldn't it be the campaign name instead? It might be more meaningful.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation Brief
Let non-numeric form IDs reach the resolver
create_request()drops any non-numeric ID before resolution, which is why OptinMonster campaign IDs never resolveget_post_type()Add an OptinMonster resolution strategy in
resolve_form_metadata()For non-numeric IDs, resolve the campaign by slug against the
omapiCPT:get_page_by_path( $form_id, OBJECT, 'omapi' )OMAPI::get_optin_by_slug()doesUse the post title as the form title
omapipost type onlynull, so the existingnull> fallback path appliesOnly call OptinMonster's own helper behind a
class_existscheck if you prefer using their API over a direct lookupThe current resolver only accepts
publish, but OptinMonster stores a campaign asdraftwhenever its remote status isn'tactive, so a paused campaign with historical conversions would fall back to its IDdraftforomapispecifically, so paused campaigns still show their name as wellTest Coverage
tests/phpunit/integration/Modules/Analytics_4/Datapoints/Get_Form_MetadataTest.php: an omapi campaign resolves its title by slug; an unknown slug resolves to null so the fallback applies; a non-omapi post sharing the same slug is not disclosed; and a draft campaign case matching whichever status decision is taken above.LeadGenerationPerformanceWidgettests with a non-numeric (string) form ID resolving to a title - today's cases only exercise numeric IDs.QA Brief
Changelog entry