Integration with custom website
This document will help you integrate your own website with Thrive. If you have your own website and want to run loyalty and referral programs, to engage with members, and enable affiliate marketing to increase customer growth, then integrating with Zoho Thrive will help you do so.
Enabling this integration is a three-step process:
1. Member tracking script
2. Sign-in tracking script
3. Purchase Push
Follow the program creation steps here. Once the program is published, follow the below steps
1. Member tracking script
Embed the following code in the head of every page of your website, between the <head> and </head> HTML tags.
<script type="text/javascript">var platformType='custom_user_site'; var thriveWidgetCode= '<Program Widget Code>';var ztUserData = {};</script><script id="thrive_script" src="https://thrivepublic.zoho.com/thrive/publicpages/thrivewidget"></script>
Properties:
Example:
<script type="text/javascript">var platformType='custom_user_site'; var thriveWidgetCode= '02e1e69452xxxxxxxxxx082e189cfd9058c71a015305278e';var ztUserData = {};</script><script id="thrive_script" src="https://thrivepublic.zoho.com/thrive/publicpages/thrivewidget"></script>
2. Member Opt-in Script
Once the member tracking script(s) is implemented, embed this code in head of every page to capture Loyalty Opt-ins and invoke pushCustomerSignup(thriveWidgetCode,ztUserData) method.
var ztUserData = {}; ztUserData['za_email_id'] = user_email_id; ztUserData['user_unique_id'] = unique_user_id; ztUserData['thrive_digest'] = hMac; ztUserData['signUpPage'] = signUpUrl; ztUserData['signInPage'] = signInUrl;
Properties:
Example:
var ztUserData = {};
ztUserData['za_email_id'] = 'peter.prescott@zylker.com';
ztUserData['user_unique_id'] = '98765432';
ztUserData['thrive_digest'] = 'akjbda923kjb32jhbbd7asda';
ztUserData['signUpPage'] = 'https://zylker.com/signup';
ztUserData['signInPage'] = 'https://zylker.com/signin';
3. Purchase API Push
Once the Member tracking and opt-in script(s) are implemented, invoke an oAuth API in your purchase completion page (Thank You page) right after completing the order.
Please refer this help page for understanding and implementing the oAuth.
Advanced configuration:
If you have used any advanced configuration in your program, please refer below
- Affiliate
Pay Period, Product Unique ID, Product Category / Group, and Pay Plan Name
Learn more - Loyalty
Custom Task
Learn more
Affiliate program
Pay Period, Product Unique ID, Product Category / Group, and Pay Plan Name
Example:
<script type="text/javascript">data['amount'] =57650;
data['order_id']='356559';
data['email']='peter.p@example.com';
data['product_payperiod']='monthly';
data['product_id']='product.example.com';
data['product_group_name']='Electronics';
data['product_plan_name']='standard_express';
</script>
Parameter | Key | Description | Example |
Email address* string | A lead/customer email address | peter.p@example.com | |
Amount* string | amount | The order amount for a transaction | 15000 |
Order ID* string | order_id | An unique number associated with every order placed | 356559 / 100CD777MM6588 |
Pay Period string | product_payperiod | Recurring payment that determines how often your customers will be charged | monthly / yearly |
Product ID string | product_id | Unique product identifier, set manually by the admin while creating a product | 9059455254 / product.example.com |
Product Category / Group string | product_group_name | A particular group of related products or products that meet similar needs. | Electronics / Kitchen_Appliances |
Pay Plan Name (Applicable only for SaaS business)string | product_plan_name | Pay plan based edition created for a particular product | Standard / Enterprise |
Loyalty program
Custom task
Once any user performs the configured custom activity, we need to send "POST" request from server.
URL: <Domain>/thrive-publicapi/v1/<widgetcode>/activities
Method: POST
Headers: Authorization : Zoho-oauthtoken <access token>
Body: {
"unique_identifier":<configured unique identifier>,
"zt_customer_id":<unique customer id>,
"email":<email id>,
"thrive_digest":<hMac>
}
Example:
URL: www.thrive.zoho.com/thrive-publicapi/v1/6cf8031f805a7dfa453c93d92e9a27e5c86c084d34f09c98f5b7b5e25e5a5e66 /activities
Headers: Authorization : 1000.6jh82dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf
Body: {
"unique_identifier":"storecustomreward",
"zt_customer_id":"CX187765G",
"email":"sdfcsdcs@dsfln.cin",
"thrive_digest":"fa04d2467feb9bbf9be79fece58d6ebc5ab01838939008f85d722a7334be3c3e"
}
Parameter | Key | Description | Example |
Unique Identifier* string | unique_identifier | A lead/customer email address | storecustomreward |
Customer ID* string | zt_customer_id | It is unique ID maintained by Admin | CX187765G |
Email ID* string | A lead/customer email address | peter.p@example.com | |
Digest* string | thrive_digest | HMAC generated from the combination of emailid, customerid and project key. Refer here | fa04d2467feb9bbf9be79fece58d6ebc5ab01838939008f85d722a7334be3c3e |
NOTE: If you want to use Thrive for multiple websites, you will need to create a separate brand for each site, and you will need to integrate.