Manually 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.
There may be a simpler way...
If you are using the Button Merchant Library to integrate your app, there is a much simpler guide here:
Button Links – mWeb Publisher Tests
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 webbrand123://home
for deeplinking to the homepage in your iOS / Android appsbrand123://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. Theorg-3eec44df0966f6f0
value represents our test Publisher organization; you will want to use that value in thebtn_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 – 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.
- Uninstall your app from the device.
- Create a Button Link via the instructions above.
- Go to the Button Link in a device's native browser.
- You will be redirected to an interstitial. Tap "Open In App"
- Upon landing in the App/Play Store, install your test app directly from Xcode, Android Studio, or an APK.
- After deeplinking into your app, make a purchase.
- Note: Verify that the screen you were routed to within the app reflects the deeplink expected.
- Obtain the order ID. This is typically sent in a confirmation email or shown in-app after the purchase is made.
- Head to the Transactions tab in the Button Dashboard.
- Search for the Order ID in the search bar at the top.
- 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.
- Create a Button Link via the instructions above.
- With your app already installed on the device, go to the Button Link in a device's native browser.
- After deeplinking into your app, make a purchase.
- Obtain the order ID. This is typically sent within a confirmation email or shown in-app after the purchase is made.
- Head to the Transactions tab in the Button Dashboard.
- Search for the Order ID in the search bar at the top.
- 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 - Ensure your app is not running
- 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
- Ensure the
btn_ref
has been stored properly on the device without any expiration time set (i.e. it should never be deleted)
App Running – Deeplink with a test Button Attribution Token
- Ensure your app is running in the background
- 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
- 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 - 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
- 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
- Uninstall your app from the device.
- Create a Button Link via the instructions above.
- Go to the Button Link in a device's native browser.
- After landing on your mobile website, take note of the
srctok-xxx
value in thebtn_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
).
- You can expect the format of the
- 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.
- Head to the Orders tab in the Button Dashboard.
- Search for the order ID or
srctok-xxx
- value in the search bar at the top.
- 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.
- 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.
- Note1: that the format of the fake
- 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.
- After deeplinking into your app, make a purchase.
- Obtain the order ID. This is typically sent in a confirmation email or shown in-app after the purchase is made.
- Head to the Orders tab in the Button Dashboard.
- Search for the Order ID in the search bar at the top.
- 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
- Modify an order that was placed through Button. For example, increase the quantity of purchased items for 1 to 2
- Head to the Transactions tab in the Button Dashboard.
- Search for the Order ID in the search bar at the top.
- 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
- Cancel an order that was placed through Button.
- Head to the Transactions tab in the Button Dashboard.
- Search for the Order ID in the search bar at the top.
- The test is a success if the order shows with the correct order total and
Status
ofdeleted
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.
Updated about 2 years ago