đĄ This document outlines the steps to integrate Bloody Good Tests (BGT) with Shopify. This will allow you to sell a test bundle directly via your Shopify or Webflow ecommerce store for your customers to then automatically be invited to the BGT platform and receive their referral.
This means that every person who buys a test through your Shopify store will automatically also be added to your Practitioner Organisation account as a new customer.
The benefit of this approach is that you can sell your products directly through BGT, or via your shopify store, or even sell the same product through a second Shopify store under a different price/name etc.
Please note: You must have a practitioner account to access the Shopify integration feature. Click here to request a practitioner account.
Prerequisites
You will need to have completed the following steps before you can configure your Shopify integration.
â
Create a Practitioner Organisation with valid billing setup
You will need to have a Shopify store.
The Setup
đĄ The following steps are for production, but can be mirrored for staging. If you wish to test this integration with a development store first, you can do so by creating a Shopify Development Store, and setup an account on the staging BGT account.
The steps in this configuration are grouped into 3 different groups:
Creating the products (bundles) within BGT that youâre selling on your Shopify page
Creating a store with BGT which handles the configuration of your external store (ie, Shopify requires a signing secret to be configured)
Mapping the internal product to an internal store with an external ID (Shopify ID).
Step 1 - Create your test bundle
Here you will create the tests inside BGT that mirror the tests you offer on your Shopify account. For example if you sell a Testosterone Test on Shopify, you need to create that test in BGT using the test builder.
Navigate to your organisation page (top right â select your organisation)
Click âTestsâ on the left, this will open up the test bundle builder.
Select what tests youâd like to add to your product and hit continue
Give it a name/description and toggle if youâd like to use this as a foundation test for other tests, hit âSave as templateâ.
You HAVE TO save a bundle as a template if you want to use it as part of the Shopify integration or API.
Repeat this process for all the tests youâd like to create
Youâll need one test per product you list on your shopify page.
Detailed How-to guide here: How to - Create a Practitioner Test Bundle
Tip: Create your bundles with the same names as you have called them on your Shopify store, that way it is much easier for you to link them up.
Step 2 - Create your Store in BGT
Once you've created your test bundles you will now need to create a store within BGT.
Think of this as a âstore configurationâ for your external store. For example, if you only have one external store, which is a Shopify store, then youâll only need one BGT store configured. But if you sell the same product on two different stores, ie a Shopify & Webflow store, then youâll need to configure two BGT stores.
Navigate to your organisation page (top right â select your organisation)
Click âSettingsâ on the left menu
Click âIntegrationsâ
Click âConfigure new storeâ
Select your store provider, give Store Name and if youâd like to change the store id, you can customise it here. Note: it canât be changed once you have picked it.
The Store Signing Secret is a value youâll need to get from your Shopify store settings. The reason we need this is to confirm that the event we received from you is actually from your store, so that other stores canât use your organisation configuration in BGT, and subsequently bill your account.
To get your signing secret, log into your Shopify store
Then select âSettingsâ (bottom left)
Then select âNotificationsâ
Then select âWebhooksâ
On this screen youâll see something that says âYour webhooks will be signed withâ and then a long hash. This is your signing secret and this is what you need to place in your store configuration in BGT.
Copy this and paste it into your BGT store configuration
Leave the Shopify tab open as we will be using it again soon.
You can now click âAddâ to add your store configuration
Your integrations page should now look something like this:
Step 3 - Associate a Test Bundle (product) with your Store on BGT
This is the critical part of the setup. It maps your Shopify Product to an internal BGT test bundle that is configured as part of your organisation.
â
This allows us to:
a.) Understand what the user has ordered in order to generate a referral
b.) Charge the correct price for the requested test
Because you could technically sell the same BGT Product through different stores, youâll need to associate a BGT bundle/product with a BGT store, and also give it the external id. This external id is the magic glue between your store and BGT being able to process the sale.
Navigate to your BGT organisation page (top right â select your organisation)
Then click âSettingsâ
Click âIntegrationsâ
Click on your newly configured store
Click âAdd saved bundle to storeâ
Now you can pick your created bundle on the left, and associate it with your external store product id.
First pick a bundle on the left
Now we need to navigate to your Shopify admin page to find the corresponding id.
Select âProductsâ
You should see all your store products here. Click into the product that matches the bundle you selected in step 6a.
The URL in the address bar will now show an id. This is your product ID that you need to put into BGT. So copy/paste this in as the external ID in BGT.
Repeat step 6 until youâve configured all the products youâd like to be able to sell via BGT.
Hit âAdd products to storeâ
Step 4 - Configure the Webhook in Shopify to point to BGT
Now that you have setup a Store, Products and the mapping/association in BGT. You can configure Shopify to actually send the sales to BGT for processing when they happen. In order to complete this, you will need your webhook URL from BGT ready to setup in Shopify.
In BGT, navigate to your organisation page (top right â select your organisation)
Click âSettingsâ
Click âIntegrationsâ
Then click your store
Scroll down until you see âWebhook configurationâ
Hit the âCopyâ button on the Webhook URL. This is the webhook URL youâll need to add to shopify.
Now open your Shopify admin page
And then select âSettingsâ in Shopify (Bottom left)
Then select âNotificationsâ
Then âWebhooksâ
Then click âCreate webhookâ
In the dialog that opens, paste the webhook URL into the âURLâ field.
Under âEventâ, select âOrder paymentâ and the API Version should be â2024-10 (Latest)â
Test a sample transaction by producing a sale on your Test store
You have now completed your integration.
đ¨ All of this is configurable/testable with our staging environment, we encourage you to try there first before moving to production
How it works - Simplified
Customer Purchases Test bundle on Practitioner Shopify Store â
Customer and Test bundle details are sent to BGT via webhook â
BGT verifies the product and bills Practitioner account automatically â
Customer is invited to create an account with BGT and a referral is generated â
Results are sent to Customer and Practitioner pages.










