Prerequisite You should have a Shopify store and administrative access to
your Growi dashboard.
How to Set Up Shopify Headless with Growi
In a few simple steps, you can set up Growi with your Shopify Headless integration to track affiliate sales and enable automated discount codes.1. Add Tracking Scripts to Your Root File
Insert the following two scripts in the<head>
section of your root HTML file:
2. Embed the Signup Form (Optional)
If you want to allow visitors to sign up as ambassadors directly on your site, you can embed the signup form on your dashboard. Place the following code in the div on the page where you would like to embed the ambassador signup form:Getting Your Program ID
To obtain the Program ID:- Navigate to your Growi dashboard
- Go to Shopify > Ambassadors Program > Setup
- Click the clipboard icon next to your program to copy the ID

PROGRAM_ID
in the code above with your actual program ID.
Example Implementation
Here’s a complete example of how to implement both steps:Troubleshooting
Here’s how to solve some common problems when setting up Shopify Headless with Growi.Scripts Not Loading
Scripts Not Loading
Ensure the scripts are placed in the
<head>
section of your root HTML file and that the URLs are correct. Check your browser’s developer console for any error messages.Affiliate Tracking Not Working
Affiliate Tracking Not Working
Verify that both tracking scripts are properly loaded and that there are no JavaScript errors preventing them from executing. The scripts should load after the page is fully rendered due to the
defer
attribute.Signup Form Not Appearing
Signup Form Not Appearing
Double-check that you have the correct Program ID and that the signup form scripts are properly included. Ensure you have administrative access to your Growi dashboard to retrieve the Program ID.
Program ID Not Found
Program ID Not Found
Navigate to Shopify > Ambassadors Program > Setup in your Growi dashboard. If you don’t see the program, ensure you have created an ambassador program first.