ePrivacy and GPDR Cookie Consent by Cookie Consent

Meiro Events

All you need to know about Meiro Events and SDK.

What is Meiro Events and how it works

Meiro Events is the first layer of the Meiro CDP stack in reaction to the recent privacy changes. It is simply a JavaScript library used for collecting customer events from website visitors. Meiro deploys complete tracking solutions – not just JavaScript trackers, but also back-end solutions for each client. It can reliably measure the behaviour of users on our clients’ websites, so seamlessly that it seems a part of the website itself. Meiro Events addresses the need for collecting customer data on the web and in apps persistently over time with 100% quality.

In a few words Meiro Events is a backend designed to be able to accept, enrich and store data from:

Meiro Events have a couple of important features:

Learn more: 3rd party cookies,  challenges of web tracking.

How it works

To identify the user, Meiro Events looks for user id cookies. In cases when a cookie can not be found Meiro Events look for it in the local storage (browser's permanent storage). It is important to know that often users delete cookies but do not clear local storage, therefore the information stored there is safer. 

In cases when it is not possible to find a user id cookie in the website’s browser, a new cookie user id is assigned to the user. 

Meiro Events server stores and enriches the events from the information collected from a website.

Usually, the request-response model browser asks the server and gets a response as a stateless protocol. Every request-response is isolated and does not have a context of previous requests and responses. So If one wishes to know that those two different events are from the same browser we can not be said from the server-side.

Here it comes Meiro Event that looks for a user id cookie on the web and tries to collect it so it is stored in the browser. If it does not find a cookie there- looks for it in local storage. 

Meiro Events stores cookie user id in multiple places- so if a user decides to delete the cookie itself, it is still in local storage where it can be found by Meiro Events.

For example, If your user connects through VPN, it will be still recognized as the same user but logged from different geolocation.

This is kind of user tracking doesn’t have the ambition to compete with your general purpose of web analytics. It is not built to replace this function.

Meiro Events is tracking an identified individual known only to you, instead of ‘an audience’.

A simple example is a demographic data that tool like Google Analytics has available. With the amount of data Google Analytics processes across all websites where it runs, it is possible to use data science to attribute to different users things like gender and age group based on exhibited behaviour such as types of pages visited.


On screenshots below, we demonstrate that we are collecting events from our web to our Meiro Events instance in:

All those browsers have uBlock Origin, AdBlock, and Ghostery installed (where available).

If you look at the screenshots, you see that all events have been successfully collected (all marked as green). It is because we are collecting data for the client, as a part of the client's application. We are not sharing the data with anyone and it is for the client's purposes. 


Learn more 

Learn more: Check different types of events possible to collect in this article.

Learn more: Check customizable events in this article. 

Learn more: How to deploy Meiro Events SDK on the website in this article. To learn about Meiro Events on mobile applications, please reach out to the team. 

Meiro Events for website

Meiro Events for website

How to deploy Meiro Events on the website

Setting up DNS records for Meiro Events

This paragraph only applies to you if you are deploying Meiro Events running on meiro.io domain (for example in PoC). If it is not the case, please skip this part and continue with next section.

Your technical point of contact in Meiro will send you an IP address of the server where the instance of Meiro Events runs just for you. 

You will need to set up two DNS record of type A. Let’s take “example.com” as an example domain where your web page runs. And let’s say that you want to deploy Meiro Events to “e.example.com” subdomain. The subdomain can be anything - you can choose, just be consistent. The DNS records for web "example.com" with Meiro Events running at "e.example.com" will need following DNS records:

Type: A, domain: e.example.com, destination: IP address of the ME

Type: A, domain: *.e.example.com, destination: IP address of the ME

How to deploy Meiro Events on your website

Following script needs to be included in the website's head (after <title> HTML tag). This script needs to be placed on EVERY page on your website, it needs to always be present on the web. 

Warning: Placing it in a different place may result in empty document.title in pageView event).

Warning: Please double-check any typos as they may result with Meiro Events not working as expected. 

Warning: The script can be deployed using any tag manager as long as you make sure that data from dataLayer are propagated properly. This is not recommended though as using the deployment with tag manager may cause data loss. 

<script type="text/javascript">
  var domain = "{{COLLECTOR_DOMAIN}}";
  var script = document.createElement("script");
  script.onload = function() {
  script.src = "//sdk." + domain;
  script.async = true;

All you need to do is to specify the collector’s domain (for example "collector.meiro.io") and define events you want to track. 

The script assumes source will be served from //sdk.{{COLLECTOR_DOMAIN}} location and it handles events collecting POST requests on {{COLLLECTOR_DOMAIN}}/ API route.

Success: By default, after inserting the above code into your website Meiro Events will collect Outbound Link Click, Page View. It is possible to add tracking of the Custom Event and Contact Form.

Warning: Please note that if your website has a language mutation site with a different structure, renamed selectors or renamed form input names, then a separate ME SDK needs to be implemented. For more information please contact Meiro team.

Learn more: How to collect page view events from the single-page application.

Learn more: All events possible to track.

Deploy Meiro Events to client's own domain vs meiro.io domain





Meiro Events for website

How to verify that Meiro Events SDK has been correctly implemented

Developers who integrate Meiro Events should be responsible for checking that all the implemented events are sent as intended. 

Learn more: How to implement Meiro Events SDK on the website.

1. Check if Meiro Events has been successfully initialized on the website

Open the website where Meiro Events has been installed on and open the browser's developer tools, go to the console and type: console.log(MeiroEvents).

Usually, you can find developers tools on Firefox go to Menu > Web Developer > Inspector > Console; on Chrome go to Menu > More Tools > Developer Tool > Console

The response would be the object with a function, for example, {init:f, track:f} means that Meiro Events works properly on the website you are visiting. 

If you do not see the object with functions as a response, for example, {init:f, track:f}please check if you followed all the steps on setting up SDK.

The possible reason may be a typo in the SDK set on the website. The console in developer tools may as well indicate the error type you are facing. 

Warning: If a problem persists, please contact the Meiro team to assist you.


2. How to check if page view events are sent properly

Open the website where Meiro Events has been installed on and open the browser's developer tools and go to the Network tab. Usually, you can find developers tools on Firefox go to Menu > Web Developer > Inspector > Console; on Chrome go to Menu > More Tools > Developer Tool > Console

Look for Request Payload displayed in the network tab with POST requests to SDK endpoint, page view event payload and response status 200 OK. 

Request payload is typically an array of objects (events), each of them contains fingerprint, session_id, timestamp, type, user_id, version, payload  (external_id if defined) as in the screenshot below.

Warning: If you initialized Meiro Events with external_id, it’s necessary to check that all types of events containing external_id in the request.

Learn more: Payloads



3. How to check contact forms submits

Check the payload

After the implementation of contact form submit, submit the form to check if works as intended.

Open the browser's developer tools, go to the Network tab and find the contactFormSubmit request.

Usually, you can find developers tools on Firefox go to Menu > Web Developer > Inspector > Console; on Chrome go to Menu > More Tools > Developer Tool > Console

Check if the payload is sent as intended. 

If you can’t find the event of the form you submitted, something is likely wrong with the implementation. 

Check if the MeiroEvents.track the method is called.

For example, insert console.log("track called") above method call and then check within the console if a method is seen.  

If yes, you can use the catch block to see the error message (example on the screenshot below). 

If the MeiroEvents.track method is not called, there may be some other problems with implementation connected to the website setting (like not catching submit events, error with data processing/transformation etc.). In that case, try to identify problems within your website code. 

Warning: If you initialized Meiro Events with external_id, it’s necessary to check that all types of events containing external_id in the request.


Check form cancellations

If the form submission is followed by immediate page transition (and your website is not the single page app/form is not sent asynchronously via javascript), then you may see cancelled event submissions. 

This should not occur for forms sent asynchronously (ajax, single-page applications, …). If you’re not sure, you can check it through slowing your internet connection via console -> network tab, send form few times and see if a cancelled event occurs.