{
  "exportFormatVersion": 2,
  "exportTime": "2026-06-08 00:00:00",
  "containerVersion": {
    "path": "accounts/0000000000/containers/00000000/versions/0",
    "accountId": "0000000000",
    "containerId": "00000000",
    "containerVersionId": "0",
    "name": "TuriTop Google Ads / GA4 example container",
    "description": "Example Google Tag Manager container preconfigured for the TuriTop booking widget conversion schema. Import it, then edit only the three Constant variables: GA4 Measurement ID (G-XXXXXXXXXX), Google Ads Conversion ID (AW-XXXXXXXXXX) and Conversion Label. Purchases dedupe on transaction_id = booking_id.",
    "container": {
      "path": "accounts/0000000000/containers/00000000",
      "accountId": "0000000000",
      "containerId": "00000000",
      "name": "TuriTop Booking Widget",
      "publicId": "GTM-XXXXXXX",
      "usageContext": ["WEB"]
    },
    "tag": [
      {
        "accountId": "0000000000",
        "containerId": "00000000",
        "tagId": "1",
        "name": "GA4 - Purchase",
        "type": "gaawe",
        "parameter": [
          { "type": "TEMPLATE", "key": "eventName", "value": "purchase" },
          { "type": "TEMPLATE", "key": "measurementIdOverride", "value": "{{Const - GA4 Measurement ID}}" },
          {
            "type": "LIST",
            "key": "eventParameters",
            "list": [
              { "type": "MAP", "map": [ { "type": "TEMPLATE", "key": "name", "value": "transaction_id" }, { "type": "TEMPLATE", "key": "value", "value": "{{DLV - booking_id}}" } ] },
              { "type": "MAP", "map": [ { "type": "TEMPLATE", "key": "name", "value": "value" }, { "type": "TEMPLATE", "key": "value", "value": "{{DLV - total}}" } ] },
              { "type": "MAP", "map": [ { "type": "TEMPLATE", "key": "name", "value": "currency" }, { "type": "TEMPLATE", "key": "value", "value": "{{DLV - currency}}" } ] },
              { "type": "MAP", "map": [ { "type": "TEMPLATE", "key": "name", "value": "item_id" }, { "type": "TEMPLATE", "key": "value", "value": "{{DLV - product_short_id}}" } ] },
              { "type": "MAP", "map": [ { "type": "TEMPLATE", "key": "name", "value": "item_name" }, { "type": "TEMPLATE", "key": "value", "value": "{{DLV - product_name}}" } ] },
              { "type": "MAP", "map": [ { "type": "TEMPLATE", "key": "name", "value": "company_short_id" }, { "type": "TEMPLATE", "key": "value", "value": "{{DLV - company_short_id}}" } ] },
              { "type": "MAP", "map": [ { "type": "TEMPLATE", "key": "name", "value": "site_url" }, { "type": "TEMPLATE", "key": "value", "value": "{{DLV - site_url}}" } ] },
              { "type": "MAP", "map": [ { "type": "TEMPLATE", "key": "name", "value": "payment_method" }, { "type": "TEMPLATE", "key": "value", "value": "{{DLV - payment_method}}" } ] }
            ]
          }
        ],
        "firingTriggerId": ["10"],
        "tagFiringOption": "ONCE_PER_EVENT",
        "notes": "Destination GA4 property is set via the Constant variable 'Const - GA4 Measurement ID'. Edit that variable, not this tag."
      },
      {
        "accountId": "0000000000",
        "containerId": "00000000",
        "tagId": "2",
        "name": "Google Ads - Conversion (Purchase)",
        "type": "awct",
        "parameter": [
          { "type": "TEMPLATE", "key": "conversionId", "value": "{{Const - Google Ads Conversion ID}}" },
          { "type": "TEMPLATE", "key": "conversionLabel", "value": "{{Const - Google Ads Conversion Label}}" },
          { "type": "TEMPLATE", "key": "orderId", "value": "{{DLV - booking_id}}" },
          { "type": "TEMPLATE", "key": "conversionValue", "value": "{{DLV - total}}" },
          { "type": "TEMPLATE", "key": "currencyCode", "value": "{{DLV - currency}}" }
        ],
        "firingTriggerId": ["10"],
        "tagFiringOption": "ONCE_PER_EVENT",
        "notes": "Set 'Const - Google Ads Conversion ID' (numeric AW id) and 'Const - Google Ads Conversion Label'. orderId = booking_id enables Google-side dedupe."
      }
    ],
    "trigger": [
      {
        "accountId": "0000000000",
        "containerId": "00000000",
        "triggerId": "10",
        "name": "Custom Event - purchase",
        "type": "CUSTOM_EVENT",
        "customEventFilter": [
          {
            "type": "EQUALS",
            "parameter": [
              { "type": "TEMPLATE", "key": "arg0", "value": "{{_event}}" },
              { "type": "TEMPLATE", "key": "arg1", "value": "purchase" }
            ]
          }
        ],
        "notes": "Fires on the TuriTop widget 'purchase' event (dataLayer push or postMessage relayed by load-turitop.js)."
      }
    ],
    "variable": [
      { "accountId": "0000000000", "containerId": "00000000", "variableId": "1", "name": "DLV - booking_id", "type": "v", "parameter": [ { "type": "INTEGER", "key": "dataLayerVersion", "value": "2" }, { "type": "TEMPLATE", "key": "name", "value": "booking_id" } ], "notes": "= transaction_id. The deduplication key for the conversion." },
      { "accountId": "0000000000", "containerId": "00000000", "variableId": "2", "name": "DLV - total", "type": "v", "parameter": [ { "type": "INTEGER", "key": "dataLayerVersion", "value": "2" }, { "type": "TEMPLATE", "key": "name", "value": "total" } ] },
      { "accountId": "0000000000", "containerId": "00000000", "variableId": "3", "name": "DLV - currency", "type": "v", "parameter": [ { "type": "INTEGER", "key": "dataLayerVersion", "value": "2" }, { "type": "TEMPLATE", "key": "name", "value": "currency" } ] },
      { "accountId": "0000000000", "containerId": "00000000", "variableId": "4", "name": "DLV - product_short_id", "type": "v", "parameter": [ { "type": "INTEGER", "key": "dataLayerVersion", "value": "2" }, { "type": "TEMPLATE", "key": "name", "value": "product_short_id" } ] },
      { "accountId": "0000000000", "containerId": "00000000", "variableId": "5", "name": "DLV - product_name", "type": "v", "parameter": [ { "type": "INTEGER", "key": "dataLayerVersion", "value": "2" }, { "type": "TEMPLATE", "key": "name", "value": "product_name" } ] },
      { "accountId": "0000000000", "containerId": "00000000", "variableId": "6", "name": "DLV - quantity", "type": "v", "parameter": [ { "type": "INTEGER", "key": "dataLayerVersion", "value": "2" }, { "type": "TEMPLATE", "key": "name", "value": "quantity" } ] },
      { "accountId": "0000000000", "containerId": "00000000", "variableId": "7", "name": "DLV - company_short_id", "type": "v", "parameter": [ { "type": "INTEGER", "key": "dataLayerVersion", "value": "2" }, { "type": "TEMPLATE", "key": "name", "value": "company_short_id" } ] },
      { "accountId": "0000000000", "containerId": "00000000", "variableId": "8", "name": "DLV - site_url", "type": "v", "parameter": [ { "type": "INTEGER", "key": "dataLayerVersion", "value": "2" }, { "type": "TEMPLATE", "key": "name", "value": "site_url" } ] },
      { "accountId": "0000000000", "containerId": "00000000", "variableId": "9", "name": "DLV - payment_method", "type": "v", "parameter": [ { "type": "INTEGER", "key": "dataLayerVersion", "value": "2" }, { "type": "TEMPLATE", "key": "name", "value": "payment_method" } ] },
      { "accountId": "0000000000", "containerId": "00000000", "variableId": "10", "name": "DLV - attribution", "type": "v", "parameter": [ { "type": "INTEGER", "key": "dataLayerVersion", "value": "2" }, { "type": "TEMPLATE", "key": "name", "value": "attribution" } ], "notes": "Object with gclid/gbraid/wbraid/gad_source/utm_* and _ga/_gcl_aw captured from the visit (postMessage path). May be empty when the visit carried no attribution." },
      { "accountId": "0000000000", "containerId": "00000000", "variableId": "11", "name": "DLV - gclid", "type": "v", "parameter": [ { "type": "INTEGER", "key": "dataLayerVersion", "value": "2" }, { "type": "TEMPLATE", "key": "name", "value": "attribution.gclid" } ] },
      {
        "accountId": "0000000000",
        "containerId": "00000000",
        "variableId": "12",
        "name": "JS - decode tt_attr (Custom Success URL)",
        "type": "jsm",
        "parameter": [
          {
            "type": "TEMPLATE",
            "key": "javascript",
            "value": "function() {\n  // Decodes the base64url-packed attribution param appended to the Custom\n  // Success URL by TuriTop (Booking_lib::urlGetParams). Returns an object with\n  // the attribution fields + payment_method, or {} if absent / unparseable.\n  // tt_attr is base64url ([A-Za-z0-9_-], no padding): reverse it before atob().\n  try {\n    var m = location.search.match(/[?&]tt_attr=([^&#]*)/);\n    if (!m) { return {}; }\n    var s = decodeURIComponent(m[1]).replace(/-/g, '+').replace(/_/g, '/');\n    while (s.length % 4) { s += '='; }\n    return JSON.parse(atob(s)) || {};\n  } catch (e) { return {}; }\n}"
          }
        ],
        "notes": "Use ONLY on the Custom Success URL page. On the postMessage fallback the attribution arrives as a dataLayer object instead (DLV - attribution)."
      },
      {
        "accountId": "0000000000",
        "containerId": "00000000",
        "variableId": "13",
        "name": "Const - GA4 Measurement ID",
        "type": "c",
        "parameter": [ { "type": "TEMPLATE", "key": "value", "value": "G-XXXXXXXXXX" } ],
        "notes": "EDIT ME: your GA4 Measurement ID."
      },
      {
        "accountId": "0000000000",
        "containerId": "00000000",
        "variableId": "14",
        "name": "Const - Google Ads Conversion ID",
        "type": "c",
        "parameter": [ { "type": "TEMPLATE", "key": "value", "value": "AW-XXXXXXXXXX" } ],
        "notes": "EDIT ME: your Google Ads conversion ID (the numeric AW id)."
      },
      {
        "accountId": "0000000000",
        "containerId": "00000000",
        "variableId": "15",
        "name": "Const - Google Ads Conversion Label",
        "type": "c",
        "parameter": [ { "type": "TEMPLATE", "key": "value", "value": "XXXXXXXXXXXXXXXXXX" } ],
        "notes": "EDIT ME: your Google Ads conversion label."
      }
    ]
  }
}
