Skip to content

Attribute campaign fallback clicks to the served offer - #14

Open
haspadar wants to merge 1 commit into
izzipizzy:mainfrom
haspadar:attribute-fallback-offer-clicks
Open

haspadar wants to merge 1 commit into
izzipizzy:mainfrom
haspadar:attribute-fallback-offer-clicks

Conversation

@haspadar

Copy link
Copy Markdown

Summary

  • Recorded the served offer on campaign fallback clicks using {offer:name} or {offer:uuid}
  • Preserved unattributed clicks for blank, 403, and 404 fallback responses
  • Added regression coverage for redirect modes and offer-token postbacks

Reproduction and verification

Configure a campaign fallback as {offer:Reserve} and either leave the campaign without a matching flow or disable its last target offer. The visitor reaches Reserve, but the click is logged with offer_id = NULL. A postback using Reserve's valid token is then rejected with HTTP 409, token/click offer mismatch.

The fix records the resolved active offer before logging redirect-style fallback clicks. The existing postback token checks remain unchanged. No migration or new dependency is required.

With the regression tests added and the runtime unchanged, 11 cases fail: ten missing offer attributions and one postback returning 409 instead of 200. With the fix:

  • Unit, integration, and architecture suites: 655 passed, 5 skipped, 0 failures
  • PHPStan: no errors
  • Composer validation and git diff --check: passed

Verification used an isolated local fixture database; no public deployment was contacted.

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