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:

<Program Widget Code> - Once the program is live, this script will be available on your Thrive -> Script page.

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:

user_email_id - Your lead/customer email address. This needs to be replaced with the respective values.
hMac - To generate HMAC, please refer to this page.
User_unique_id - Provide customer unique ID. This should not be modified.
signUpUrl / signInUrl - Provide your website sign up and sign in URLs.

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>
ParameterKeyDescriptionExample
Email address* stringEmailA lead/customer email addresspeter.p@example.com
Amount* stringamountThe order amount for a transaction15000
Order ID* stringorder_idAn unique number associated with every order placed356559 / 100CD777MM6588
Pay Period stringproduct_payperiodRecurring payment that determines how often your customers will be chargedmonthly / yearly
Product ID stringproduct_idUnique product identifier, set manually by the admin while creating a product9059455254 / product.example.com
Product Category / Group stringproduct_group_nameA particular group of related products or products that meet similar needs.Electronics / Kitchen_Appliances
Pay Plan Name (Applicable only for SaaS business)stringproduct_plan_namePay plan based edition created for a particular productStandard / 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"
}
ParameterKeyDescriptionExample
Unique Identifier* stringunique_identifierA lead/customer email addressstorecustomreward
Customer ID* stringzt_customer_idIt is unique ID maintained by AdminCX187765G
Email ID* stringemailA lead/customer email addresspeter.p@example.com
Digest* stringthrive_digestHMAC generated from the combination of emailid, customerid and project key. Refer herefa04d2467feb9bbf9be79fece58d6ebc5ab01838939008f85d722a7334be3c3e

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.