Zoho Commerce site builder
If you want to add the Identifier API to the Zoho Commerce site builder, follow the below-mentioned steps:
1. Open your store where the Identifier API needs to be inserted. Navigate to Site Settings.
2. Under General, select Header & Footer code and add the below code:
-
<script>
-
function getuserDetail(){
-
$X.get({
-
url: '/portaluser/getCurrentPortalUser',
-
handler: function () {
-
var response = JSON.parse(this.responseText);
-
if(response.status_message === "success"){
-
if(response.current_user.user!== 'null'){
-
let userEmail = response.current_user.emailid;
-
window.pagesense = window.pagesense || [];
-
window.pagesense.push(['identifyUser',userEmail ]);
-
}
-
}
-
}
-
})
-
}
-
window.addEventListener('load', getuserDetail);
-
</script>
|
3. Click on Save and Publish the site.
Zoho Sites builder
If you want to add the Identifier API to the Zoho Sites builder, follow the below-mentioned steps:
1. Login to your Zoho Sites account.
2. Open your Website > Site settings.
3. Under General, click on Header and Footer code to insert the code.
4. Paste the below Identifier API code in the Header region:
-
<script>
-
function getuserDetail(){
-
$X.get({
-
url: '/portaluser/getCurrentPortalUser',
-
handler: function () {
-
var response = JSON.parse(this.responseText);
-
if(response.status_message === "success"){
-
if(response.current_user.user!== 'null'){
-
let userEmail = response.current_user.emailid;
-
window.pagesense = window.pagesense || [];
-
window.pagesense.push(['identifyUser',userEmail ]);
-
}
-
}
-
}
-
})
-
}
-
window.addEventListener('load', getuserDetail);
-
</script>
|
5. Click Save and Publish.
Zoho SalesIQ
If you want to add the Identifier API to the Zoho SalesIQ, follow the below-mentioned steps:
Copy and paste the following Javascript Identifier API code inside your website's JS code:\
- $zoho.salesiq.ready=function()
- {
- $zoho.salesiq.visitor.chat(function(visitid,data)
- {
- window.pagesense = window.pagesense || [];
- window.pagesense.push(['identifyUser', data.email]);
- });
- }
- $zoho.salesiq.visitor.offlineMessage(function(visitid,data)
- {
- window.pagesense = window.pagesense || [];
- window.pagesense.push(['identifyUser', data.email]);
- });