Skip to main content

gtm_gluebox_ drupal_ workspace .json

Tag me up

GTM / Google Tag Manager & Ghost Traffic Mitigation Strategies

 

{
  "containerVersion": {
    "container": {
      "publicId": "GTM-XXXXXXX",
      "name": "GlueBox Drupal GTM"
    },
    "tag": [
      {
        "name": "GA4 - Config (Drupal Only)",
        "type": "ga4-config",
        "parameter": [
          {
            "key": "measurementId",
            "value": "G-XXXXXXXXXX"
          },
          {
            "key": "sendPageView",
            "value": "true"
          }
        ],
        "trigger": [
          {
            "type": "TRIGGER",
            "triggerId": "5"
          }
        ]
      }
    ],
    "trigger": [
      {
        "triggerId": "5",
        "name": "Drupal Pages Only",
        "type": "PAGEVIEW",
        "filter": [
          {
            "type": "MATCH_REGEX",
            "parameter": [
              {
                "key": "arg0",
                "type": "TEMPLATE",
                "value": "{{Page Hostname}}"
              },
              {
                "key": "arg1",
                "type": "TEMPLATE",
                "value": "^(www\\.)?gluebox\\.com$"
              }
            ]
          }
        ]
      }
    ],
    "variable": [
      {
        "name": "Page Hostname",
        "type": "jsm",
        "parameter": [
          {
            "key": "javascript",
            "value": "function() { return document.location.hostname; }"
          }
        ]
      },
      {
        "name": "Drupal User Role",
        "type": "jsm",
        "parameter": [
          {
            "key": "javascript",
            "value": "function() { return window.drupalSettings?.gluebox?.user_role || 'unknown'; }"
          }
        ]
      },
      {
        "name": "Drupal Content Type",
        "type": "jsm",
        "parameter": [
          {
            "key": "javascript",
            "value": "function() { return window.drupalSettings?.gluebox?.content_type || 'unknown'; }"
          }
        ]
      }
    ]
  }
}