Creatio can now import site events recorded by the Matomo tracking service as part of processing form submissions from landing pages integrated via webhooks.
The Matomo+Creatio+Landingi integration allows you to collect statistics and track visitors’ behavior, and additionally, pass the visitor’s ID to Matomo during form submission.
Tracking visitors’ behavior
1. Install the Matomo connector for Creatio and set it up according to the instructions.
2. Add custom JavaScript code to your landing page in Landingi: go to Dashboard > JavaScript Code and click Add new script.
3. Read this guide and get your Matomo code.
4. Name (1) the script: Matomo, and choose the Head (2) position on Both (3) pages. Paste the code in the content field (4). Save by clicking Add script.
Matomo should be able to track your visitors right away.
Passing visitors’ ID
1. If you want to pass the visitor’s ID during form submission, follow all Tracking visitors’ behavior steps.
2. Then add one more JavaScript code. Copy the code:
<script>
function createOrReplaceInput(inputName, inputValue, formSelector, currentForm) {
var existingInput = jQuery(formSelector + " input[name='" + inputName +"']")[0];
if (existingInput) {
existingInput.value = inputValue;
} else {
var newInput = document.createElement('input');
newInput.setAttribute('type', 'hidden');
newInput.setAttribute('name', inputName);
newInput.setAttribute('value', inputValue);
currentForm.appendChild(newInput);
}
}
/* The function below generates individual VisitorId and sync it with Matomo. */
function defineVisitor() {
_paq.push([ function () {
var visitorId = this.getVisitorId();
var currentUrl = window.location.href;
//foreach form add hidden fields with names: TrackingUserId
var formsCollection = document.getElementsByTagName('form');
for(var i = 0; i < formsCollection.length; i++) {
var formSelector = "";
if (formsCollection[i].id) {
formSelector = "#"+formsCollection[i].id;
} else if(formsCollection[i].name) {
formSelector = "form[name='" + formsCollection[i].name + "']";
}
createOrReplaceInput("TrackingUserId", visitorId, formSelector, formsCollection[i]);
createOrReplaceInput("PageUrl", currentUrl, formSelector, formsCollection[i]);
}
}])
}
jQuery(document).ready(defineVisitor);
</script>
3. Name (1) the script: Matomo Tracking UserID on Form Submit, and choose the Body bottom (2) position on the Main page (3). Paste the code in the content field (4). Save by clicking Add script.
Tracking data will be passed to Contacts created after submitting the web form. You can find the tracking data on the Contact page under Web Sessions and Web Actions.
Browse all integrations in our Integrations Catalog to see tools you can connect Landingi with.