Skip to content

Commit

Permalink
Move app store redirector docs to attribution docs
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgibson committed Apr 15, 2024
1 parent aff4707 commit a367117
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 43 deletions.
59 changes: 43 additions & 16 deletions docs/attribution/0003-firefox-mobile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,58 @@ To help streamline creating app store referral links we have `app_store_url()` a

For example:

```
play_store_url('firefox', 'firefox-home')
app_store_url('firefox', 'firefox-home')
```
.. code-block:: jinja
play_store_url('firefox', 'firefox-home')
app_store_url('firefox', 'firefox-home')
Would render:

```
https://apps.apple.com/us/app/apple-store/id989804926?pt=373246&ct=firefox-home&mt=8
https://play.google.com/store/apps/details?id=org.mozilla.firefox&referrer=utm_source%3Dwww.mozilla.org%26utm_medium%3Dreferral%26utm_campaign%3Dfirefox-home&hl=en
```
.. code-block::
https://apps.apple.com/us/app/apple-store/id989804926?pt=373246&ct=firefox-home&mt=8
https://play.google.com/store/apps/details?id=org.mozilla.firefox&referrer=utm_source%3Dwww.mozilla.org%26utm_medium%3Dreferral%26utm_campaign%3Dfirefox-home&hl=en
For Firefox Focus:

```
play_store_url('focus', 'firefox-browsers-mobile-focus')
app_store_url('focus', 'firefox-browsers-mobile-focus')
```
.. code-block:: jinja
play_store_url('focus', 'firefox-browsers-mobile-focus')
app_store_url('focus', 'firefox-browsers-mobile-focus')
Would render:

```
https://apps.apple.com/us/app/apple-store/id1055677337?pt=373246&ct=firefox-home&mt=8
https://play.google.com/store/apps/details?id=org.mozilla.focus&referrer=utm_source%3Dwww.mozilla.org%26utm_medium%3Dreferral%26utm_campaign%3Dfirefox-home&hl=en
```
.. code-block::
https://apps.apple.com/us/app/apple-store/id1055677337?pt=373246&ct=firefox-home&mt=8
https://play.google.com/store/apps/details?id=org.mozilla.focus&referrer=utm_source%3Dwww.mozilla.org%26utm_medium%3Dreferral%26utm_campaign%3Dfirefox-home&hl=en
App store redirects
-------------------

Occasionally we need to create a link that can auto redirect to either the Apple
App Store or the Google Play Store depending on user agent. A common use case is
to embed inside a QR Code, which people can then scan on their phone to get a
shortcut to the app. To make this easier bedrock has a special redirect URL to
which you can add product and campaign query strings. When someone hits the
redirect URL, bedrock will attempt to detect their mobile platform and then auto
redirect to the appropriate app store.

The base redirect URL is ``https://www.mozilla.org/firefox/browsers/mobile/app/``,
and to it you can add both a ``product`` and ``campaign`` query parameter. For
example, the following URL would redirect to either Firefox on the Apple App Store
or on the Google Play Store, with the specified campaign parameter.

.. code-block::
https://www.mozilla.org/firefox/browsers/mobile/app/?product=firefox&campaign=firefox-whatsnew
.. note::

The ``product`` and ``campaign`` parameters are limited to a set of strictly
trusted values. To add more product and campaign options, you can add those
values to the ``mobile_app`` helper function in
`firefox/redirects.py <https://github.com/mozilla/bedrock/blob/main/bedrock/firefox/redirects.py>`_.

Where can I find mobile attribution data?
-----------------------------------------
Expand Down
27 changes: 0 additions & 27 deletions docs/redirects.rst
Original file line number Diff line number Diff line change
Expand Up @@ -195,30 +195,3 @@ against a remote instance of the site (e.g. production) it will run a lot
quicker by running the tests in parallel. To do this, you can add ``-n auto``
to the command line. Replace ``auto`` with an integer if you want to set the
maximum number of concurrent processes.

Mobile app store redirects
--------------------------

Occasionally we need to create a link that can auto redirect to either the Apple
App Store or the Google Play Store depending on user agent. A common use case is
to embed inside a QR Code, which people can then scan on their phone to get a
shortcut to the app. To make this easier bedrock has a special redirect URL to
which you can add product and campaign query strings. When someone hits the
redirect URL, bedrock will attempt to detect their mobile platform and then auto
redirect to the appropriate app store.

The base redirect URL is ``https://www.mozilla.org/firefox/browsers/mobile/app/``,
and to it you can add both a ``product`` and ``campaign`` query parameter. For
example, the following URL would redirect to either Firefox on the Apple App Store
or on the Google Play Store, with the specified campaign parameter.

.. code-block::
https://www.mozilla.org/firefox/browsers/mobile/app/?product=firefox&campaign=firefox-whatsnew
.. note::

The ``product`` and ``campaign`` parameters are limited to a set of strictly
trusted values. To add more product and campaign options, you can add those
values to the ``mobile_app`` helper function in
`firefox/redirects.py <https://github.com/mozilla/bedrock/blob/main/bedrock/firefox/redirects.py>`_.

0 comments on commit a367117

Please sign in to comment.