{
  "exportFormatVersion": 2,
  "exportTime": "2026-09-25 00:32:28",
  "containerVersion": {
    "path": "accounts/0/containers/0/versions/0",
    "accountId": "0",
    "containerId": "0",
    "containerVersionId": "0",
    "name": "Safirion Tracking",
    "description": "Tags do dashboard de tracking Safirion. Endpoint: https://tracking.partnersafirion.com/api/track",
    "container": {
      "accountId": "0",
      "containerId": "0",
      "name": "Safirion Tracking",
      "publicId": "GTM-XXXXXXX",
      "usageContext": [
        "WEB"
      ],
      "fingerprint": "1790296348794"
    },
    "tag": [
      {
        "accountId": "0",
        "containerId": "0",
        "tagId": "1",
        "name": "Safirion - Tag base (UTM + pageview)",
        "type": "html",
        "parameter": [
          {
            "type": "TEMPLATE",
            "key": "html",
            "value": "<script>\n(function () {\n  var ENDPOINT = \"https://tracking.partnersafirion.com/api/track\";\n  var KEY = \"sfr_utm\", CID_KEY = \"sfr_cid\", DAYS = 90;\n  // utm_source que o próprio site injeta (fluxo OAuth etc.). Não é campanha.\n  var IGNORE = [\"external_app_oauth\"];\n\n  function qs(name) {\n    var m = new RegExp(\"[?&]\" + name + \"=([^&#]*)\").exec(window.location.search);\n    return m ? decodeURIComponent(m[1].replace(/\\+/g, \" \")) : \"\";\n  }\n  function store(k, v) { try { localStorage.setItem(k, v); } catch (e) {} }\n  function load(k) { try { return localStorage.getItem(k); } catch (e) { return null; } }\n  function uid() {\n    return Date.now().toString(36) + \"-\" + Math.random().toString(36).slice(2, 10);\n  }\n\n  // 1) client_id persistente por navegador\n  var cid = load(CID_KEY);\n  if (!cid) { cid = uid(); store(CID_KEY, cid); }\n\n  // 2) captura UTMs da URL e guarda por 90 dias (última interação vence)\n  var fromUrl = {\n    utm_source: qs(\"utm_source\"), utm_medium: qs(\"utm_medium\"), utm_campaign: qs(\"utm_campaign\"),\n    utm_content: qs(\"utm_content\"), utm_term: qs(\"utm_term\")\n  };\n  var landed = !!(fromUrl.utm_source || fromUrl.utm_medium || fromUrl.utm_campaign) && IGNORE.indexOf((fromUrl.utm_source || \"\").toLowerCase()) === -1;\n  var utm = null;\n  if (landed) {\n    fromUrl.exp = Date.now() + DAYS * 864e5;\n    store(KEY, JSON.stringify(fromUrl));\n    utm = fromUrl;\n  } else {\n    try { utm = JSON.parse(load(KEY) || \"null\"); } catch (e) { utm = null; }\n    if (utm && utm.exp && utm.exp < Date.now()) { utm = null; }\n  }\n\n  // 3) função global usada pelas outras tags (sfrHasUtm diz se a pessoa veio por link)\n  window.sfrHasUtm = !!utm;\n  window.sfrTrack = function (event, data) {\n    data = data || {};\n    // Sem uma campanha atribuída, não polui o dashboard com navegação orgânica.\n    if (!utm) return;\n    var payload = {\n      event: event,\n      client_id: cid,\n      event_id: data.event_id || (cid + \"-\" + uid()),\n      page_url: window.location.href,\n      referrer: document.referrer || null\n    };\n    if (utm) {\n      payload.utm_source = utm.utm_source || null;\n      payload.utm_medium = utm.utm_medium || null;\n      payload.utm_campaign = utm.utm_campaign || null;\n      payload.utm_content = utm.utm_content || null;\n      payload.utm_term = utm.utm_term || null;\n    }\n    for (var k in data) { if (data[k] !== undefined && data[k] !== null && data[k] !== \"\") payload[k] = data[k]; }\n    var body = JSON.stringify(payload);\n    // text/plain evita preflight de CORS. Se o navegador recusar o beacon,\n    // usa XHR como fallback para não perder a chegada durante redirecionamentos.\n    var queued = false;\n    try {\n      if (navigator.sendBeacon) queued = navigator.sendBeacon(ENDPOINT, new Blob([body], { type: \"text/plain\" }));\n    } catch (e) {}\n    if (!queued) {\n      var x = new XMLHttpRequest();\n      x.open(\"POST\", ENDPOINT, true);\n      x.setRequestHeader(\"Content-Type\", \"text/plain\");\n      x.send(body);\n    }\n  };\n\n  // 4) chegada com UTM conta como clique no link; páginas seguintes de quem veio por link viram \"pagina\"\n  if (landed) window.sfrTrack(\"pageview\", { label: document.title });\n  else if (utm) window.sfrTrack(\"pagina\", { label: document.title });\n})();\n</script>"
          },
          {
            "type": "BOOLEAN",
            "key": "supportDocumentWrite",
            "value": "false"
          }
        ],
        "fingerprint": "1790296348794",
        "firingTriggerId": [
          "2147479553"
        ],
        "tagFiringOption": "ONCE_PER_EVENT",
        "monitoringMetadata": {
          "type": "MAP"
        },
        "consentSettings": {
          "consentStatus": "NOT_SET"
        },
        "priority": {
          "type": "INTEGER",
          "value": "10"
        }
      },
      {
        "accountId": "0",
        "containerId": "0",
        "tagId": "2",
        "name": "Safirion - Conversoes (registro, ftd, redeposito)",
        "type": "html",
        "parameter": [
          {
            "type": "TEMPLATE",
            "key": "html",
            "value": "<script>\n(function () {\n  if (!window.sfrTrack) return;\n  window.sfrTrack({{Event}}, {\n    value: {{DLV - value}},\n    currency: {{DLV - currency}},\n    user_id: {{DLV - user_id}},\n    event_id: {{DLV - transaction_id}},\n    dados: {\n      nome: {{DLV - nome}},\n      email: {{DLV - email}},\n      telefone: {{DLV - telefone}}\n    }\n  });\n})();\n</script>"
          },
          {
            "type": "BOOLEAN",
            "key": "supportDocumentWrite",
            "value": "false"
          }
        ],
        "fingerprint": "1790296348794",
        "firingTriggerId": [
          "10"
        ],
        "tagFiringOption": "ONCE_PER_EVENT",
        "monitoringMetadata": {
          "type": "MAP"
        },
        "consentSettings": {
          "consentStatus": "NOT_SET"
        }
      },
      {
        "accountId": "0",
        "containerId": "0",
        "tagId": "3",
        "name": "Safirion - Cliques",
        "type": "html",
        "parameter": [
          {
            "type": "TEMPLATE",
            "key": "html",
            "value": "<script>\n(function () {\n  // só grava cliques de quem chegou por link com UTM\n  if (!window.sfrTrack || !window.sfrHasUtm) return;\n  var text = ({{Click Text}} || \"\").toString().trim();\n  var url = {{Click URL}} || \"\";\n  var id = {{Click ID}} || \"\";\n  var label = text || id || url;\n  if (!label) return;\n  window.sfrTrack(\"clique\", { label: label.slice(0, 120), page_url: window.location.href });\n})();\n</script>"
          },
          {
            "type": "BOOLEAN",
            "key": "supportDocumentWrite",
            "value": "false"
          }
        ],
        "fingerprint": "1790296348794",
        "firingTriggerId": [
          "11"
        ],
        "tagFiringOption": "ONCE_PER_EVENT",
        "monitoringMetadata": {
          "type": "MAP"
        },
        "consentSettings": {
          "consentStatus": "NOT_SET"
        }
      },
      {
        "accountId": "0",
        "containerId": "0",
        "tagId": "4",
        "name": "Safirion - Conversoes nativas",
        "type": "html",
        "parameter": [
          {
            "type": "TEMPLATE",
            "key": "html",
            "value": "<script>\n(function () {\n  if (!window.sfrTrack) return;\n  var entries = window.dataLayer || [];\n  var current = entries.length ? entries[entries.length - 1] : {};\n  var category = (current.eventCategory || \"\").toString().toLowerCase();\n  var label = (current.eventLabel || \"\").toString().toLowerCase();\n  if (category !== \"conversions\") return;\n  var eventName = null;\n  if (label === \"signup\" || label === \"sign_up\" || label === \"registration\") eventName = \"registro\";\n  else if (label === \"ftd\" || label === \"firstdeposit\" || label === \"first_deposit\") eventName = \"ftd\";\n  else if (label === \"redeposit\" || label === \"redeposito\" || label === \"re_deposit\") eventName = \"redeposito\";\n  if (eventName) window.sfrTrack(eventName, {});\n})();\n</script>"
          },
          {
            "type": "BOOLEAN",
            "key": "supportDocumentWrite",
            "value": "false"
          }
        ],
        "fingerprint": "1790296348794",
        "firingTriggerId": [
          "12"
        ],
        "tagFiringOption": "ONCE_PER_EVENT",
        "monitoringMetadata": {
          "type": "MAP"
        },
        "consentSettings": {
          "consentStatus": "NOT_SET"
        }
      }
    ],
    "trigger": [
      {
        "accountId": "0",
        "containerId": "0",
        "triggerId": "10",
        "name": "Safirion - Evento registro|ftd|redeposito",
        "type": "CUSTOM_EVENT",
        "customEventFilter": [
          {
            "type": "MATCH_REGEX",
            "parameter": [
              {
                "type": "TEMPLATE",
                "key": "arg0",
                "value": "{{_event}}"
              },
              {
                "type": "TEMPLATE",
                "key": "arg1",
                "value": "^(registro|ftd|redeposito)$"
              }
            ]
          }
        ],
        "fingerprint": "1790296348794"
      },
      {
        "accountId": "0",
        "containerId": "0",
        "triggerId": "11",
        "name": "Safirion - Todos os cliques",
        "type": "CLICK",
        "fingerprint": "1790296348794"
      },
      {
        "accountId": "0",
        "containerId": "0",
        "triggerId": "12",
        "name": "Safirion - Evento nativo owox_event",
        "type": "CUSTOM_EVENT",
        "customEventFilter": [
          {
            "type": "EQUALS",
            "parameter": [
              {
                "type": "TEMPLATE",
                "key": "arg0",
                "value": "{{_event}}"
              },
              {
                "type": "TEMPLATE",
                "key": "arg1",
                "value": "owox_event"
              }
            ]
          }
        ],
        "fingerprint": "1790296348794"
      }
    ],
    "variable": [
      {
        "accountId": "0",
        "containerId": "0",
        "variableId": "20",
        "name": "DLV - value",
        "type": "v",
        "parameter": [
          {
            "type": "BOOLEAN",
            "key": "setDefaultValue",
            "value": "false"
          },
          {
            "type": "TEMPLATE",
            "key": "name",
            "value": "value"
          },
          {
            "type": "INTEGER",
            "key": "dataLayerVersion",
            "value": "2"
          }
        ],
        "fingerprint": "1790296348794",
        "formatValue": {}
      },
      {
        "accountId": "0",
        "containerId": "0",
        "variableId": "21",
        "name": "DLV - currency",
        "type": "v",
        "parameter": [
          {
            "type": "BOOLEAN",
            "key": "setDefaultValue",
            "value": "false"
          },
          {
            "type": "TEMPLATE",
            "key": "name",
            "value": "currency"
          },
          {
            "type": "INTEGER",
            "key": "dataLayerVersion",
            "value": "2"
          }
        ],
        "fingerprint": "1790296348794",
        "formatValue": {}
      },
      {
        "accountId": "0",
        "containerId": "0",
        "variableId": "22",
        "name": "DLV - user_id",
        "type": "v",
        "parameter": [
          {
            "type": "BOOLEAN",
            "key": "setDefaultValue",
            "value": "false"
          },
          {
            "type": "TEMPLATE",
            "key": "name",
            "value": "user_id"
          },
          {
            "type": "INTEGER",
            "key": "dataLayerVersion",
            "value": "2"
          }
        ],
        "fingerprint": "1790296348794",
        "formatValue": {}
      },
      {
        "accountId": "0",
        "containerId": "0",
        "variableId": "23",
        "name": "DLV - transaction_id",
        "type": "v",
        "parameter": [
          {
            "type": "BOOLEAN",
            "key": "setDefaultValue",
            "value": "false"
          },
          {
            "type": "TEMPLATE",
            "key": "name",
            "value": "transaction_id"
          },
          {
            "type": "INTEGER",
            "key": "dataLayerVersion",
            "value": "2"
          }
        ],
        "fingerprint": "1790296348794",
        "formatValue": {}
      },
      {
        "accountId": "0",
        "containerId": "0",
        "variableId": "24",
        "name": "DLV - nome",
        "type": "v",
        "parameter": [
          {
            "type": "BOOLEAN",
            "key": "setDefaultValue",
            "value": "false"
          },
          {
            "type": "TEMPLATE",
            "key": "name",
            "value": "nome"
          },
          {
            "type": "INTEGER",
            "key": "dataLayerVersion",
            "value": "2"
          }
        ],
        "fingerprint": "1790296348794",
        "formatValue": {}
      },
      {
        "accountId": "0",
        "containerId": "0",
        "variableId": "25",
        "name": "DLV - email",
        "type": "v",
        "parameter": [
          {
            "type": "BOOLEAN",
            "key": "setDefaultValue",
            "value": "false"
          },
          {
            "type": "TEMPLATE",
            "key": "name",
            "value": "email"
          },
          {
            "type": "INTEGER",
            "key": "dataLayerVersion",
            "value": "2"
          }
        ],
        "fingerprint": "1790296348794",
        "formatValue": {}
      },
      {
        "accountId": "0",
        "containerId": "0",
        "variableId": "26",
        "name": "DLV - telefone",
        "type": "v",
        "parameter": [
          {
            "type": "BOOLEAN",
            "key": "setDefaultValue",
            "value": "false"
          },
          {
            "type": "TEMPLATE",
            "key": "name",
            "value": "telefone"
          },
          {
            "type": "INTEGER",
            "key": "dataLayerVersion",
            "value": "2"
          }
        ],
        "fingerprint": "1790296348794",
        "formatValue": {}
      }
    ],
    "builtInVariable": [
      {
        "accountId": "0",
        "containerId": "0",
        "type": "EVENT",
        "name": "Event"
      },
      {
        "accountId": "0",
        "containerId": "0",
        "type": "CLICK_TEXT",
        "name": "Click Text"
      },
      {
        "accountId": "0",
        "containerId": "0",
        "type": "CLICK_URL",
        "name": "Click URL"
      },
      {
        "accountId": "0",
        "containerId": "0",
        "type": "CLICK_ID",
        "name": "Click ID"
      },
      {
        "accountId": "0",
        "containerId": "0",
        "type": "PAGE_URL",
        "name": "Page URL"
      }
    ],
    "fingerprint": "1790296348794",
    "tagManagerUrl": "https://tagmanager.google.com/"
  }
}