Skip to content

Add Adjust opt-in redirect for Firefox Android attribution#17159

Merged
slightlyoffbeat merged 1 commit intomainfrom
mobile-attribution-adjust
May 7, 2026
Merged

Add Adjust opt-in redirect for Firefox Android attribution#17159
slightlyoffbeat merged 1 commit intomainfrom
mobile-attribution-adjust

Conversation

@slightlyoffbeat
Copy link
Copy Markdown
Contributor

@slightlyoffbeat slightlyoffbeat commented May 5, 2026

Add an opt-in path through Adjust on the existing /r/mobile/ redirect so Firefox Android installs from mozilla.org can be attributed in the "mozorg-mobile-redirect" channel in Adjust. Triggered only when the request includes ?via=adjust, the product is firefox, and the User-Agent is Android; all other cases fall through to today's Play Store / App Store logic untouched.

The Adjust link URL is configurable via the ADJUST_FIREFOX_ANDROID_LINK env var so dev/stage can point at a separate link to keep test installs out of production attribution data.

If this changeset needs to go into the FXC codebase, please add the WMO and FXC label.

One-line summary

Significant changes and points to review

Issue / Bugzilla link

Testing

Local manual (curl) — verify bedrock returns the right destination

With npm start running on localhost:8080, run each curl and check the Location: header:

  • Android + via=adjust + firefox → expects Adjust URL with &campaign= appended

    curl -sI \
      -A "Mozilla/5.0 (Linux; Android 13; Pixel 7) AppleWebKit/537.36" \
      "http://localhost:8080/firefox/browsers/mobile/app/?via=adjust&product=firefox&campaign=test-001" \
      | grep -i ^location

    Expect: https://app.adjust.com/20kona3j?fallback=…&redirect_macos=…&campaign=test-001

  • Android + no via (regression check) → expects Play Store with UTM referrer

    curl -sI \
      -A "Mozilla/5.0 (Linux; Android 13; Pixel 7) AppleWebKit/537.36" \
      "http://localhost:8080/firefox/browsers/mobile/app/?product=firefox&campaign=test-002" \
      | grep -i ^location

    Expect: https://play.google.com/store/apps/details?id=org.mozilla.firefox&referrer=…utm_campaign%3Dtest-002

  • iOS + via=adjust (flag should be ignored) → expects App Store

    curl -sI \
      -A "Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X)" \
      "http://localhost:8080/firefox/browsers/mobile/app/?via=adjust&product=firefox&campaign=test-003" \
      | grep -i ^location

    Expect: https://apps.apple.com/app/apple-store/id989804926?pt=373246&ct=test-003…

  • Android + via=adjust + focus (flag should be ignored, scope is firefox-only) → expects Play Store Focus

    curl -sI \
      -A "Mozilla/5.0 (Linux; Android 13; Pixel 7) AppleWebKit/537.36" \
      "http://localhost:8080/firefox/browsers/mobile/app/?via=adjust&product=focus&campaign=test-004" \
      | grep -i ^location

    Expect: https://play.google.com/store/apps/details?id=org.mozilla.focus&referrer=…

  • Bogus via value → expects Play Store fallback (default behavior)

    curl -sI \
      -A "Mozilla/5.0 (Linux; Android 13; Pixel 7) AppleWebKit/537.36" \
      "http://localhost:8080/firefox/browsers/mobile/app/?via=bogus&product=firefox&campaign=test-005" \
      | grep -i ^location

    Expect: Play Store URL, not Adjust

End-to-end attribution (real Android device)

  • On an Android device or emulator without Firefox installed, navigate to:
    http://<dev-or-stage-host>/firefox/browsers/mobile/app/?via=adjust&product=firefox&campaign=e2e-pr-test-001
  • Follow the redirect chain → land on Play Store → install Firefox → open it once
  • In Adjust dashboard (5–10 min later), verify a row appears under:
    channel = mozorg-mobile-redirect, campaign = e2e-pr-test-001
  • Repeat with a different campaign value to confirm bedrock forwards distinct values as separate rows

Add an opt-in path through Adjust on the existing /r/mobile/ redirect so
Firefox Android installs from mozilla.org can be attributed in the "mozorg-mobile-redirect" channel in Adjust. Triggered only when the request includes ?via=adjust, the product is firefox, and the User-Agent is Android; all other cases fall through to today's Play Store / App
Store logic untouched.

The Adjust link URL is configurable via the ADJUST_FIREFOX_ANDROID_LINK env var so dev/stage can point at a separate link to keep test installs out of production attribution data.
@slightlyoffbeat slightlyoffbeat requested a review from a team as a code owner May 5, 2026 23:30
@slightlyoffbeat slightlyoffbeat requested a review from stevejalim May 5, 2026 23:30
@slightlyoffbeat slightlyoffbeat added the WMO and FXC Code relevant to both mozilla/bedrock (www.mozilla.org) and mozmeao/springfield (www.firefox.com) label May 5, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.04%. Comparing base (c603937) to head (ebb9072).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #17159      +/-   ##
==========================================
+ Coverage   81.99%   82.04%   +0.04%     
==========================================
  Files         179      179              
  Lines        9530     9538       +8     
==========================================
+ Hits         7814     7825      +11     
+ Misses       1716     1713       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread bedrock/settings/base.py
Copy link
Copy Markdown
Contributor

@stevejalim stevejalim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+wc

Didn't test the Android emulator flow - unable to

@slightlyoffbeat slightlyoffbeat merged commit ce21479 into main May 7, 2026
5 checks passed
@slightlyoffbeat slightlyoffbeat deleted the mobile-attribution-adjust branch May 7, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

WMO and FXC Code relevant to both mozilla/bedrock (www.mozilla.org) and mozmeao/springfield (www.firefox.com)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants