Here is a video to guide you through integrating the Basic Integration Snippet:
The basic integration and authentication snippet serves two purposes:
- Member Enrollment: It passes the information of the user logged-in on your website to Zinrelo so that Zinrelo can authenticate the user, initiate a session and log the user into the loyalty program.
A customized basic integration and authentication code snippet for your account is available in your Zinrelo Admin Console in the ‘General’ tab under ‘Integration’.
Populate the following fields dynamically: ‘partner_id’, ‘email’, ‘name’, ‘user_id', 'ts', 'access_token'. These fields contain end-user information – email, user full name and user_id – and the rest of the fields - 'ts' and 'access_token' are required for ensuring the security and integrity of the data passed.
For a logged in user, these must be filled dynamically wherever available. For a guest/non-logged in user, you can simply pass the 'partner_id' and pass empty string ('') for the rest of the values.
If only the user_id field is not available to Zinrelo on a particular page, it is still assumed that the customer is not logged in to the website and will be logged out of the loyalty program too.
Shown below is the detailed description of the fields to be populated dynamically. All fields are required and must be populated for the loyalty rewards program to work.
- partner_id: This is an alpha-numeric value assigned that uniquely identifies your account in Zinrelo. You can find your Partner ID in Zinrelo Admin Console > General > Settings section . If you have any trouble getting your Partner ID, please contact our Customer Success Manager or email [email protected]
- email: This is the email address of the user who is logged in to your website e.g - [email protected] . Zinrelo uses this email address to identify a user record in Zinrelo database. It is used to associate loyalty transactions and to communicate with and re-engage the user.
- name: This is the full name of the user who is logged in to your website. This information is used to address the user on the loyalty rewards dashboard and to include in the email templates sent to the user.
- user_id: This is the unique identifier of the user in your database. Zinrelo uses this ID as an additional identifier for the user.
- ts: This is the current timestamp in unix epoch format. For e.g 1602058996.
- access_token: This is the SHA256 hash of the string formed by concatenating - user_id, email, partner_id, api_key and ts - in the same order as mentioned. This will be string with 64 characters. When Zinrelo receives all the above values , it generates its own SHA256 hash with the API key from your account and matches it with the access_token you passed. This is to verify the authenticity of the data. In order to generate access_token, you will need an API key. You can find your API Key in Zinrelo Admin Console > General > Settings section just below the Partner ID. If you have any trouble implementing the logic to generate access_token, please reach out to [email protected]
- Please note that you do not share your API key with anyone or anywhere. It should be used only in the backend systems.
- language: This is the multi-language option we provide to members. They can list the languages in which they want their dashboard to be.
- tags:. Multiple comma separated tags can be assigned to the member. The tags passed through the script are appended to the existing tags the member may have. Tags are useful to apply business rules and filter the members to run campaigns.
Here are some common mistakes in including the Basic Integration Snippet:
- Partner ID is copied as-is from this document: The partner_id field is a unique key generated by Zinrelo to identify a Client. Please confirm that your partner_id is correct. If you are copying code from the Zinrelo Admin Console, the partner_id will be correct. If you are copying as-is from this document, the partner_id will be wrong.
- Integration snippet is copied as-is: The fields must be filled dynamically from the information available on the website. Therefore, a developer with some technical skills is required to complete this task. It is not a mere copy and paste.
Updated 3 months ago