Track the user interactions within the Neocom advisor.
There are different events through which you can track the interactions of your customers within the Neocom advisor and transfer them to your own tracking system (e.g. Google Analytics).
To accurately evaluate the impact of Neocom, we strongly recommend tracking the user before and after entering the Neocom advisor. In addition, you can compare the KPIs of the customers that use the advisor with those that do not. Thus, you can collect first party data from Neocom and use it for retargeting, for example.
KPIs to compare could include
- Bounce rate
- Session duration
- Conversion rate
- Average shopping cart value
How it works
neocomActionCallback
) into your website. This function enables Neocom to capture specific user events like starting an advisor session or answering a question. Once captured, these events can be transferred to tools like Google Analytics for further analysis.Implementation
- Location: Ideally, place the script in the header of your webpage, alongside the Global Embed Code.
- Function:
neocomActionCallback
activates when specific user events occur.
- Payload: Each event triggers a payload object.
- Contents: The payload includes:
action
: Name of the event.data
: Additional event details.neocomID
: Unique identifier for the advisor.meta
: ContainsconversationId
(tracks individual interactions with an advisor),integrationType
(shows advisor integration method) andsessionId
(identifies a user across a browser session).
- CONVERSATION_STARTED
a. Trigger: When the advisor is loaded and displayed.
b. Frequency: Once per session.
c.data
: Empty. - CONVERSATION_INTERACTED:
a. Trigger: User clicks on the advisor.
b. Frequency: Once per session.
c. `data`: Empty. - QUESTION_ANSWERED:
a. Trigger: Each time a user answers a question.
b.data
Structure:
i:question
: Object withid
andname
.
ii:answers
: Array of objects withid
andname
.
iii:isEndOfConversation
: Boolean indicating if the conversation is complete.
iv:products
: Array of recommended products, each withid
(SKU),name
.
v:selectedPriceRange
: Object withmin
,max
(prices), andcurrency
(3-letter code). - SAVE_FOR_LATER_EMAIL_REQUESTED:
a. Trigger: User submits the Save For Later form
b. Frequency: Can be multiple times per session
c.data
Structure:
i:
email_address
: The email address of the user
ii:products
: Array of up to 3 recommended products, each withid
(SKU),name
.
<script>
function neocomActionCallback(payload) {
const action = payload.action;
const data = payload.data;
const meta = payload.meta;
// Add you custom business logic here.
// Below is an example to send the data to Google Tag Manager
if (window.dataLayer) {
dataLayer.push({
"event": "Neocom",
"action": payload.action,
"advisorId": meta.advisorId,
"conversationId": meta.conversationId,
"sessionId": meta.sessionId,
"payload": payload.data
});
}
}
</script>
Result Tracking
By clicking on a suggested product in the results, the product detail page of your store will be loaded. To tell the store that this product was recommended by Neocom, the parameter neocom_source with the ID of your Neocom consultant is added to the URL.
This info in the URL can be used to reference it in Google Analytics, for example, and create segments.