Skip to main content
Global Monitoring is an Enterprise feature, which enables companies to agnostically monitor any network request departing the webpage. This is especially useful if you are intending to monitor more than just tags/pixels/events from a particular JS container, but you are looking to monitor any request no matter which JS based container it is made from whether the script was loaded on the HTML head/body, a via a tag manager or a CMS etc). This can be used to monitor:
  • Marketing/conversion events to platforms like google ads or facebook
  • Data layer events
  • Analytics or CDP events to platforms like GA4, Adobe Analytics or Tealium/Segment CDP
  • Any outgoing HTTP event (so long as you know the URL header)

Instructions

  1. Click ‘New Domain’ and your domain and select the Monitoring Tab
  2. Provide the System you wish to Monitor events from.
Note the base Javascript for all Global Monitoring is quite similar, the various tag manager flavours differ in the specific metadata they automatically pick up from the browser.
    Google Tag Manager Global will access google_tag_manager and take the container name and version. Tealium Global will access utag and take the profile name and version. Adobe Global will access _satellite and access the launch property and version. Tag commander will access tC and access account, container and environment.Other is an Agnostic Browser JS SDK and can be run on any browser or any system not specifically mentioned (e.g Segment, Ensighten etc).
  1. Next provide the Domain you wish to ingest events from and press enter (you can add subdomains here) Add domain
  2. Start adding Vendors by Clicking new Vendor Vendor List
  3. Search for an existing Vendor or create a Custom Vendor
    Add custom vendor

    Create a custom vendor

    Add existing vendor

    Search for existing providers

  4. Fill in the Monitoring Form for the specific Vendor you have Chosen Vendor configuration screen The form has several crucial fields to complete:
This is the domain which client side pixel/tag requests are sent to. Typically known as the request URL e.g. for Facebook, “facebook.com/tr”.
Use this field to specify which keys you would like to exclude from monitoring. e.g. Facebook sends an “sw” parameter with screen width. If you don’t want/need to monitor that key, enter it here. This field also accepts regex. Regex should be encapsulated within forward slashes /. As an example if you entered /^(data\.loader|data\.timing)\./ this would ensure that anything starting with data.loader. and data.timing. would not be monitored.
Used to specify which key in the vendors payload corresponds to the event name. You can specify either a single field by name, or multiple fields inside curly braces e.g. {{fieldA}}-{{fieldB}}. Here is an example request with the event in the “ev” parameter:Mapped event examplesYou can also extract a field value via regular-expression.E.g. You may want to extract a sub-domain from a URL and add it to the event, this can be done by find inf the correct regex and applying it to the field parameter in the following format:regex::(?<=https:\/\/)[\w|-]*::urlThis format represents 3 sections, separated by double-colons (::). The 3 sections are:
  • regex which inpforms the expression parser that the user is passing a regex expression
  • (?<=https:\/\/)[\w|-]* is the regular expression itself (javascript regex supported. Test your regex in any regex editor such are Regexr)
  • url is the field from which the content is extracted. You may use a dot (.) separated field path. (url, host, method and vendorName are automatically added to the payload)
The following event field eve-{{regex::(?<=https:\/\/)[\w|-]*::url}} (multiple digits) on value of field “myfield”. In a payload { url: "https://subdomain.myapp.com" }, the event field will be eve-subdomain.
Regular Expression allows for capturing text in relation to the existence of other text before it or after it. This is called lookahead and lookbehind
Use this to focus your monitoring to specific vendor requests e.g. only where “ev” = “orderSuccess”. This can also help reduce API call consumption.
  1. After completing your Vendor Form press the Apply and then the Save button. To Manage simply enter this form again, edit and you will notice the Deployment Version at the bottom increment by 1. Vendor added to list
  2. Follow your installation guide which will provide you with your particular installation guide (depending on which System you selected). Installing monitoring script
  3. Once you have deployed your Monita Script to your Domain, test and troubleshoot to make the script is deployed, the Monita tag is firing and events are streamed to Monita.
  1. Visit the domain where you installed Monita on (make sure ad blockers are off)
  2. Open the browser console and type __monita_settings
  3. If that loads this means the Script is present on your page
  4. Within the Global object you will notice the script version this should align with what you see within Domain Setup in the Deployment Version (visible next to the Bin icon)
  5. If you want to refresh the script on your page just add the following query string paramater to your url which and refresh the page. ?monitarefresh=1
    Monita settings in dev console

    Monita settings in your browser console

    Monita deployment version

    Your Deployment Version visible down below

  1. Go to the domain you are monitoring
  2. Open the Developer Network Tab (F12)
  3. Fire off any of the Vendors/Events you have monitored in the platform
  4. Filter requests for v1/or raptor.digital
  5. Confirm you can see successful 🟢 204 requests going to our endpoint
    Monita deployment version

    Monita settings in your browser console

Open the Visualisation Tab in Monita.You should be able to see your events grouped by Vendor and Event and filter for any of the keys that have been ingested from each vendor/event by Expanding an event and filtering on the Data Tab.
If you have not completed your Event Mapping Field, from your Vendor Setup, events will not group by event, they will be instead only be grouped by a Vendor with the event being blank. You will know event is mapped properly if it appears on the client side in the e parameter shown belowMapped event examples
Visualisation

Custom Functions

When installing Monita script, you can declare custom functions calculate some fields in the Monita payload. The fields that can be overridden include:
  • Session ID sid [get_session_id]
  • Customer ID cid [get_customer_id]
  • Consent cn [get_consent]
  • event e [get_event] (takes vendor name and payload as parameters)
You can add the functions in this object: Mapped event examples You can also prevent Monita from executing using a function [is_monita_allowed] that takes Monita payload as argument and returns true (allowed) or false (not allowed). If you have specific environment fields, related to a TMS (Tag Management System) not supported by Monita, or other ebvironment fields you want to override, you can sepcify a function [get_tms_data] that takes windowas parameter and return an object of environment fields. The fields you can override are:
  • System s (e.g. tealium)
  • System release version rl (.e.g v1.1.5)
  • Environment name env (e.g. prod)
  • Domain / Container ID …etc do (e.g. GTM-123456)
  • Execution time et in milliseconds (e.g. 1733731798766),
  • Tag ID, where you can tell which “tag” is associated with this vendor event fire (e.g. 110)

Examples

// custom object example
{
  get_session_id: function() {
    return sessionStorage.getItem("sid");
  },
  get_customer_id: function() {
    return getCookie("cust_id"); // custom function can be found here https://stackoverflow.com/a/15724300
  },
  get_consent: function() {
    return getCookie("allow_instruments"); // custom function can be found here https://stackoverflow.com/a/15724300
  },
  get_event: function(vendorName, data) {
    if(vendorName == "Google Analytics 4") {
      return data.en;
    } else if (vendorName == "Custom") {
      if(data.commerce) {
        if(data.commerce.purcahse) {
          return "purchase"
        } else if (data.commerce.checkout) {
          return "checkout"
        } else {
          return "cart"
        }
      } else {
        return "pageview"
      }
    } else {
      return null; // will default to whatever default event field or user-specified event field is set for this vendor
    }
  }, is_monita_allowed: function(monitaPayload) {
    return monitaPayload.p == "/checkout"; // `p` = path name
  },
  get_tms_data: function(windowArg) {
    return {
      s: "custom",
      rl: windowArg.customEnv.v,
      env: windowArg.customEnv.name
    };
  }
}