Test your Integration

Test your Integration

This guide walks you through how to test your Button integration. 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.

In this guide, we’ll test:

Note: Button must complete their own QA in order to launch your integration into the Button Marketplace. As such, we requiere that you share iOS & Android test builds.

Button Links Test

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 correctly within apps that open within an embedded webview (e.g. Slack, Facebook) or an email client.

Button Links Deferred Deeplinking

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. Go to the Button Link in a device's native browser.
  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, Android Studio, or an APK.
  6. After deeplinking into your app, make a purchase.
  • Note: Verify that the screen you were routed to within the app reflects the deeplink expected.
  1. Obtain the order ID. This is typically sent in a confirmation email or shown in-app after the purchase is made.
  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.

Button Links 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, go to the Button Link in a device's native browser.
  3. After deeplinking into your app, make a purchase.
  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.

Order Attribution Test

Each time a Publisher drives a purchase, they generate a commission. This section tests to make sure Button attribution is properly tracking these 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 value in the search bar at the top.
  8. 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:

  • A freshly installed app that's never been launched
  • An app that has been launched but is not currently 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 Test

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 Test

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 Solutions Engineer who can assist with any questions.