Skip to content

Vue Application - Advanced Options ​

Suppression Tag ​

Use this tag if you would like to suppress activity on specific pages of the website. We will need to handle this with the page visit tag and conversion tag; luckily, we can use an if statement to handle this.

  1. Using your router, place in the below snippet

    NOTE: This MUST ONLY be triggered on a page to be suppressed.

  2. Update access key (Your_Access_Key), leaving single quotes intact
    Ex.) AccessKey: ‘000000000000’
    javascript
    router.afterEach((to, from) => {
      const MGX = typeof Window.MGX === "undefined" ? [] : Window.MGX;
      if (to.name === "order-confirmation") {
        MGX.push({
          AccessKey: "Your_Access_Key", //Must be set in MGX object or passed with commit
          Label: "Conversion",
          Info: "Order", //Optional piece of meta data to enable classification of different conversion types/events.
          OrderId: "SomeId",
          OrderTotal: "###.##",
        });
      } else if (to.name === "router-to-suppress") {
        MGX.push({
          AccessKey: "Your_Access_Key", //Must be set in MGX object or passed with commit
          Info: "suppress",
        });
      } else {
        MGX.push({
          AccessKey: "Your_Access_Key",
        });
      }
    });