Testing your Button integration

This guide covers how to test your Button integration that is not using the Button Merchant Library. It’s suggested you perform these tests as you complete each component of the integration; and if something doesn’t work as expected, reach out to your Button representative for assistance.

Note: Button will also complete separate QA prior to launch. As such, we require test iOS & Android builds.

Button Links Testing

Mobile Web Publishers

Mobile web Publishers add Button Links to their mobile website to drive users to your app or mobile website. This section tests to make sure Button Links are properly routing users to your site/app and attributing orders correctly.
Before you begin testing, let your Button representative know so they can setup the test Publisher configuration for you. They will need to know a few things about your website and/or apps, including where Button should be routing users to on your website and app. For example:

  • https://www.brand123.com for mobile web
  • brand123://home for deeplinking to the homepage in your iOS / Android apps
  • brand123://products/123 for deeplinking to Product pages in your iOS / Android apps

When Button has confirmed setup, construct a Button Link using your homepage link and place within a webpage:

https://r.bttn.io?btn_ref=org-3eec44df0966f6f0&btn_url=https%3A%2F%2Fbrand123.com

Please note:

  • The btn_ref value in the Button Link represents the Publisher's Button Organization ID. The org-3eec44df0966f6f0 value represents our test Publisher organization; you will want to use that value in the btn_ref parameter of all your Button Links tests.
  • Button Links may not work as expected within apps that open within an embedded webview (e.g. Slack, Facebook) or an email client.

Testing Button Links Attribution

Post-Install attribution

This test will verify that traffic driven from the web to your app, specifically through an install, will route users to the proper page in your app and will attribute orders through that app install.

  1. Uninstall your app from the device.
  2. Create a Button Link via the instructions above.
  3. Add the link into your Notes App and tap to open.
  4. You will be redirected to an interstitial. Tap "Open In App"
  5. Upon landing in the App/Play Store, install your test app directly from Xcode, TestFlight, Android Studio, or an APK.
  6. After deeplinking into your app, make a purchase.
    1. Note: Verify that you were properly routed to the intended in-app destination.
  7. Obtain the order ID. This is typically sent in a confirmation email or shown in-app after the purchase is made.
  8. Head to the Transactions tab in the Button Dashboard.
  9. Search for the Order ID in the search bar at the top.
  10. The test is a success if the order shows with the correct order total.

Order Affiliation

This test will verify that traffic driven from the web to your app will route users to the proper page in your app and will attribute orders through that app install.

  1. Create a Button Link via the instructions above.
  2. With your app already installed on the device, add the Button Link to your Notes App and tap to open.
  3. After deeplinking into your app, make a purchase.
    1. Note: Verify that you were properly routed to the intended in-app destination.
  4. Obtain the order ID. This is typically sent within a confirmation email or shown in-app after the purchase is made.
  5. Head to the Transactions tab in the Button Dashboard.
  6. Search for the Order ID in the search bar at the top.
  7. The test is a success if the order shows with the correct order total.
    Button Attribution Token Storage Tests
    Cold Start – Deeplink with a test Button Attribution Token
  8. Ensure your app is not running
  9. Open your app with a scheme-based link, passing the Button Attribution Token (btn_ref) in as a query string parameter, e.g.: yourappscheme://?btn_ref=test-token-1
  10. Ensure the btn_ref has been stored properly on the device without any expiration time set (i.e. it should never be deleted)

Deeplink with a Button Attribution Token

  1. Ensure your app is running in the background
  2. Open your app with a scheme-based link, passing the Button Attribution Token (btn_ref) in as a query string parameter, e.g.: yourappscheme://?btn_ref=test-token-1
  3. Ensure the btn_ref has been stored properly on the device without any expiration time set (i.e. it should never be deleted)

Deeplink with a different test Button Attribution Token

  1. Open your app with a scheme-based, link, passing the Button Attribution Token (btn_ref) in as a query string parameter with a value different than what you used in the previous test, e.g. yourappscheme://?btn_ref=test-token-2
  2. Ensure the new btn_ref has been stored properly on the device and correctly replaced the value from the previous test without any expiration time set (i.e. it should never be deleted)

Order Reporting Tests

Each time a Publisher drives a purchase, they generate a commission. This section tests to make sure Button attribution is properly tracking these orders.

New orders

Mobile Web

  1. Uninstall your app from the device.
  2. Create a Button Link via the instructions above.
  3. Go to the Button Link in a device's native browser.
  4. After landing on your mobile website, take note of the srctok-xxx value in the btn_ref parameter on the resulting link.
    • You can expect the format of the btn_ref value to be: ^srctok-[a-f0-9]{16}$ (e.g. srctok-abcdef0123456789).
  5. Make a purchase, taking note of the order ID. This is typically sent in a confirmation email or shown on the website after the purchase is made.
  6. Head to the Orders tab in the Button Dashboard.
  7. Search for the order ID or srctok-xxx
  8. value in the search bar at the top.
  9. The test is a success if the order shows with the correct order total.

iOS & Android

Make sure to test each of the following scenarios with the steps outlined below:

  • Cold Start – an app that has been launched but is not currently running
  • App Running – an app that is running in the background

Note: this test will work on mobile devices that already have installed your test app.

  1. Construct a scheme-based link for your app, including a test Button Attribution Token. Here's a sample link: brand123://home?btn_ref=fakesrctok-abcdef0123456789
    • Note1: that the format of the fake srctok is: ^fakesrctok-[a-f0-9]{16}$ (e.g.fakesrctok-abcdef0123456789).
    • Note2: Do not use the same fakesrctok-xxx value multiple times.
  2. Execute this link and land into your app.
    • On iOS, paste this link into your notes app. Clicking the link there should deeplink you into your app.
    • On Android, paste this link into your native browser. Clicking the link should prompt you to open your app.
  3. After deeplinking into your app, make a purchase.
  4. Obtain the order ID. This is typically sent in a confirmation email or shown in-app after the purchase is made.
  5. Head to the Orders tab in the Button Dashboard.
  6. Search for the Order ID in the search bar at the top.
  7. The test is a success if the order shows with the correct order total.
    Adjustments Tests

Note: it’s easiest to use one of the test orders in one of the previous sections

  1. Modify an order that was placed through Button. For example, increase the quantity of purchased items for 1 to 2
  2. Head to the Transactions tab in the Button Dashboard.
  3. Search for the Order ID in the search bar at the top.
  4. The test is a success if the order shows with the correct order total.
    Cancellations Tests

Note: it’s easiest to use one of the test orders in one of the previous sections

  1. Cancel an order that was placed through Button.
  2. Head to the Transactions tab in the Button Dashboard.
  3. Search for the Order ID in the search bar at the top.
  4. The test is a success if the order shows with the correct order total and status of deleted

Order Payload Validation

Button requires the following list of fields be reported for all orders. Note: some of these fields may not yet be a technical requirement of Button’s Order API, i.e. may not be needed to receive an HTTP
200 response code.

order_id
total
currency
purchase_date
btn_ref
customer_order_id
line_items[].identifier
line_items[].total
line_items[].quantity
line_items[].description
line_items[].sku
line_items[].upc
line_items[].category

Tests Completed by Button

There are a few tests that must be completed by Button’s QA team before launch; they will complete these for you and verify all functionality is working as expected.

Getting Help

Having trouble testing your apps? Reach out to your Button representative who can assist with any questions.