ePrivacy and GPDR Cookie Consent by Cookie Consent Skip to main content

How to deploy Meiro Events on the website

Create Meiro Events Server 

Below is the sequence of steps to follow for setting up Meiro Events SDK on your website:

  1. The Meiro IT team will create a Meiro Events server that runs only for your website.
  2. Your technical point of contact at Meiro will send you the public IP address of the Meiro Events server. 

     

Set up DNS records for Meiro Events on your own domain

    3. You will need to set up one DNS record of type A. 

    • For instance, “example.com”com is an example domain where your web page runs and you want to deploy Meiro Events to the “me.example.com”com subdomain. The subdomain can be anything you choose as long as it is a subdomain. The DNS records for web "example.com" with Meiro Events running at "me.example.com"com" will need the following DNS record:

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

   4. Inform the Meiro team once it is completed.   
   5. Meiro’s IT team will be reconfiguring your Meiro Events server to accept the connection and use SSL termination from the newly created DNS endpoint.

Deploy Meiro Events basic tracking scripts on your website

   6. After the DNS record is set up, the 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. 

   7. Specify the collector’s domain (for example "me.example.com"com") and define the events you want to track. 

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

<script type="text/javascript">
var domain = "{{COLLECTOR_DOMAIN}}";
var script = document.createElement("script");
script.onload = function() {
MeiroEvents.init(domain);
MeiroEvents.track("pageView");
MeiroEvents.track("outboundLinkClick");
};
script.src = "//" + domain + "/sdk/";
script.async = true;
document.head.appendChild(script);
</script>

Remember: By default, after inserting the above code into your website, Meiro Events will collect Outbound Link Click and Page View. It is also possible to track other types of events including  Custom Event and Contact Form.

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

Warning: Please double-check for any typos as they may result in 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. 

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 the Meiro team.

Learn more: How to verify that Meiro Events SDK has been correctly implemented

Learn More: How are Meiro Events different from Google Analytics & Google Tag Manager

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

Learn more: All events possible to track

Learn MoreEvents: custom events (Optional)

Learn MoreEvents: contact forms(Optional)forms (Optional)

 FAQs

Is the DNS record required internally and externally (public)?

The DNS record has to be a public record as it is for public usage.

What would be the source clients connecting to this DNS record?

It will be for general website visitors.

Why is there a need for the wildcard DNS A record *.me.example.com? 

Wildcard *.me.example.com is needed due to the backwards compatibility with the older version of Meiro Events without changing the collector's domain in the website script (Refer to How to deploy Meiro Events on your website section).