Tracking interaction with the message (reading, clicks, response).
This method should be called when you use the autocommunication
with the Run script (in the browser) type and want to track which
of the visitors read, answered or clicked in your message.
Suppose that you have your own popup, which is run by the showMyPopup()
function.
Then your code for the JS auto-message will look like this:
// Show pop-up. Inserts an element with ID #my-popup into DOM
showMyPopup();
// Record the fact of the message read
// sending_id will be automatically replaced with sending ID
dashly.trackMessageInteraction('{{ sending_id }}', 'read');
// Record the fact of the message being replied
$('#my-popup #my-input').change(function() {
dashly.trackMessageInteraction('{{ sending_id }}', 'replied');
});
// Record the fact of an element of the message clicked
$('#my-popup #my-label').click(function() {
dashly.trackMessageInteraction('{{ sending_id }}', 'clicked');
});
Note that if clicking results in redirection to another page, click might not be tracked correctly.
Argument | Description |
---|---|
sendingId |
Required. Sending ID |
type |
Required. Interaction type. Can have value: read , replied , clicked |