跟踪代码管理器 API - 代码字典参考

本文档介绍了可以为 Google 跟踪代码管理器代码设置的参数。

简介

每个 Google 跟踪代码管理器代码都有一个用于自我识别的 type 代码。此外,大多数代码都包含参数(keytype 对),您可以在创建或更新代码时将其设为“参数对象”的一部分。要详细了解如何使用参数对象设置这些参数,请参阅参数参考

下文中列出了所有受支持的网络移动代码的详细信息。

网络代码

自定义 HTML 代码

类型代码

html

参数
类型
html template
convertJsValuesToExpressions boolean
usePostscribe boolean
示例
{
  "liveOnly": false,
  "name": "Sample Custom HTML",
  "parameter": [
    {
      "key": "html",
      "type": "template",
      "value": "<script>alert('hello world')</script>"
    },
    {
      "key": "convertJsValuesToExpressions",
      "type": "boolean",
      "value": "true"
    },
    {
      "key": "usePostscribe",
      "type": "boolean",
      "value": "false"
    }
  ],
  "type": "html"
}

自定义图片代码

类型代码

img

参数
类型
useCacheBuster boolean
url template
cacheBusterQueryParam template
示例
{
  "liveOnly": false,
  "name": "Sample Custom Image Tag",
  "parameter": [
    {
      "key": "useCacheBuster",
      "type": "boolean",
      "value": "true"
    },
    {
      "key": "url",
      "type": "template",
      "value": "//{{a}}"
    },
    {
      "key": "cacheBusterQueryParam",
      "type": "template",
      "value": "gtmcb"
    }
  ],
  "type": "img"
}

事件监听器

链接点击监听器

类型代码

lcl

参数
类型 备注
checkValidation boolean
waitForTags boolean
waitForTagsTimeout template 毫秒数。
指定 waitForTags=true 的时间。
示例
{
   "name": "Sample Link Click Listener",
   "liveOnly": false,
   "parameter": [
    {
     "type": "boolean",
     "key": "waitForTags",
     "value": "true"
    },
    {
     "type": "boolean",
     "key": "checkValidation",
     "value": "true"
    },
    {
     "type": "template",
     "key": "waitForTagsTimeout",
     "value": "2000"
    }
   ],
   "type": "lcl",
  }

表单提交监听器

类型代码

fsl

参数
类型 备注
waitForTags boolean
checkValidation boolean
waitForTagsTimeout template 毫秒数。
指定 waitForTags=true 的时间。
示例
{
  "liveOnly": false,
  "name": "Sample Form Submit Listener",
  "parameter": [
    {
      "key": "waitForTags",
      "type": "boolean",
      "value": "false"
    },
    {
      "key": "checkValidation",
      "type": "boolean",
      "value": "false"
    }
  ],
  "type": "fsl"
}

点击监听器

类型代码

cl

参数

示例
{
  "liveOnly": false,
  "name": "Sample Click Listener",
  "type": "cl"
}

计时器监听器

类型代码

tl

参数
类型 备注
eventName template
interval template 毫秒数
limit template 触发次数上限
示例
{
  "liveOnly": false,
  "name": "Sample Timer Listener",
  "parameter": [
    {
      "key": "eventName",
      "type": "template",
      "value": "gtm.timer"
    },
    {
      "key": "interval",
      "type": "template",
      "value": "{{a}}"
    },
    {
      "key": "limit",
      "type": "template",
      "value": "5"
    }
  ],
  "type": "tl"
}

JavaScript 错误监听器

类型代码

jel

参数

示例
{
  "liveOnly": false,
  "name": "Sample JavaScript Error Listener",
  "type": "jel"
}

历史记录监听器

类型代码

hl

参数

示例
{
  "liveOnly": false,
  "name": "Sample History Listener",
  "type": "hl"
}

展示广告跟踪

Floodlight 计数器

类型代码

flc

参数
类型 备注
ordinalType template STANDARDUNIQUESESSION 中的一个
advertiserId template
groupTag template
activityTag template
useImageTag boolean
customVariable list [keyvalue] 对
userVariable template 代码的 u= 变量。
transactionVariable template 代码的 tran= 变量。
sessionId template 指定 ordinalType 是否为 SESSION
示例
{
  "liveOnly": false,
  "name": "Sample Floodlight Counter",
  "parameter": [
    {
      "key": "ordinalType",
      "type": "template",
      "value": "STANDARD"
    },
    {
      "key": "advertiserId",
      "type": "template",
      "value": "{{a}}"
    },
    {
      "key": "groupTag",
      "type": "template",
      "value": "{{b}}"
    },
    {
      "key": "activityTag",
      "type": "template",
      "value": "{{c}}"
    },
    {
      "key": "useImageTag",
      "type": "boolean",
      "value": "false"
    },
    {
      "key": "customVariable",
      "type": "list"
 "list": [
     {
       "type": "map",
       "map": [
        {
         "type": "template",
         "key": "key",
         "value": "u2"
        },
        {
         "type": "template",
         "key": "value",
         "value": "u2_custom_var"
        }
       ]
      },
      {
       "type": "map",
       "map": [
        {
         "type": "template",
         "key": "key",
         "value": "u1"
        },
        {
         "type": "template",
         "key": "value",
         "value": "u1_custom_var"
        }
     ]
    },
    {
      "key": "userVariable",
      "type": "template",
      "value": ""
    },
    {
      "key": "transactionVariable",
      "type": "template",
      "value": ""
    },
    {
     "type": "template",
     "key": "sessionId",
     "value": "MySessionId"
    }
  ],
  "type": "flc"
}

Floodlight 销售

类型代码

fls

参数
类型 备注
countingMethod template TRANSACTIONSITEM_SOLD
advertiserId template
groupTag template
activityTag template
revenue template
orderId template
useImageTag boolean
customVariable map 映射列表,每个映射都有一个 [keyvalue] 对。
userVariable template 代码的 u= 变量。
transactionVariable template 代码的 tran= 变量。
quantity template 指定 countingMethod 是否为 ITEM_SOLD
示例
{
   "name": "Sample Floodlight Sales Tag",
   "liveOnly": false,
   "parameter": [
    {
     "type": "template",
     "key": "countingMethod",
     "value": "TRANSACTIONS"
    },
    {
     "type": "template",
     "key": "advertiserId",
     "value": "{{a}}"
    },
    {
     "type": "template",
     "key": "groupTag",
     "value": "{{b}}"
    },
    {
     "type": "template",
     "key": "activityTag",
     "value": "{{c}}"
    },
    {
     "type": "template",
     "key": "revenue",
     "value": "{{a}}"
    },
    {
     "type": "template",
     "key": "orderId",
     "value": "{{b}}"
    },
    {
     "type": "boolean",
     "key": "useImageTag",
     "value": "false"
    },
    {
     "type": "map",
     "key": "customVariable",
     "map": [
      {
       "type": "template",
       "key": "u2",
       "value": "u2_custom_var"
      },
      {
       "type": "template",
       "key": "u1",
       "value": "u1_custom_var"
      }
     ]
    },
    {
     "type": "template",
     "key": "userVariable",
     "value": "u_var"
    },
    {
     "type": "template",
     "key": "transactionVariable",
     "value": "tran_var"
    }
   ],
   "type": "fls"
  }

Mediaplex - IFRAME MCT 代码

类型代码

mpm

参数
类型 备注
placementId template
roiName template
pageName template
uniqueUserId template 可选。
示例
{
   "name": "Sample Mediaplex IFRAME MCT Tag",
   "liveOnly": false,
   "parameter": [
    {
     "type": "template",
     "key": "placementId",
     "value": "{{a}}"
    },
    {
     "type": "template",
     "key": "roiName",
     "value": "1"
    },
    {
     "type": "template",
     "key": "pageName",
     "value": "{{a}}"
    }
   ],
   "type": "mpm"
  }

Mediaplex - 标准 IMG ROI 代码

类型代码

mpr

参数
类型 备注
placementId template
roiName template
uniqueUserId template 可选。
示例
{
   "name": "Sample Mediaplex Standard IMG ROI Tag",
   "liveOnly": false,
   "parameter": [
    {
     "type": "template",
     "key": "placementId",
     "value": "{{a}}"
    },
    {
     "type": "template",
     "key": "roiName",
     "value": "1"
    },
    {
     "type": "template",
     "key": "uniqueUserId",
     "value": "MyUniqueId"
    }
   ],
   "type": "mpr"
  }

Turn Conversion Tracking

类型代码

tc

参数
类型 备注
customerId template Data Contract ID
orderId template 可选。
orderValue template 可选。
optOut template 可选。
示例
{
   "name": "Sample Turn Conversion Tracking",
   "liveOnly": false,
   "parameter": [
    {
     "type": "template",
     "key": "customerId",
     "value": "{{a}}"
    },
    {
     "type": "template",
     "key": "orderId",
     "value": "MyOrderId"
    },
    {
     "type": "template",
     "key": "orderValue",
     "value": "MyOrderValue"
    },
    {
     "type": "template",
     "key": "optOut",
     "value": "MyOptOut"
    }
   ],
   "type": "tc"
  }

再营销

AdRoll Smart Pixel

类型代码

asp

参数
类型 备注
customerId template adroll_adv_id
pixelId template adroll_pix_id
conversionValueInDollars template 可选。
customData map 可选。映射列表,每个映射都有一个 [keyvalue] 对。
segmentName template 可选。
示例
{
   "name": "Sample AdRoll Smart Pixel",
   "liveOnly": false,
   "parameter": [
    {
     "type": "template",
     "key": "customerId",
     "value": "{{a}}"
    },
    {
     "type": "template",
     "key": "pixelId",
     "value": "{{a}}"
    },
    {
     "type": "template",
     "key": "conversionValueInDollars",
     "value": "conversionValue"
    },
    {
     "type": "map",
     "key": "customData",
     "map": [
      {
       "type": "template",
       "key": "key2",
       "value": "World"
      },
      {
       "type": "template",
       "key": "key1",
       "value": "Hello"
      }
     ]
    },
    {
     "type": "template",
     "key": "segmentName",
     "value": "SegmentName"
    }
   ],
   "type": "asp"
  }

Google Ads 再营销

类型代码

sp

参数
类型 备注
googleConversionId template
googleConversionLabel template 可选。
customParamsFormat template DATA_LAYERUSER_SPECIFIED
dataLayerVariable template 适用于 customParamsFormat = DATA_LAYER
googleCustomParams list 适用于 customParamsFormat = USER_SPECIFIED
googleScreenName template 可选。
示例

其中 customParamFormat = DATA_LAYER

{
   "name": "Sample Google Ads Remarketing",
   "liveOnly": false,
   "parameter": [
    {
     "type": "template",
     "key": "googleConversionId",
     "value": "{{c}}"
    },
    {
     "type": "template",
     "key": "googleConversionLabel",
     "value": "MyLabel"
    },
    {
     "type": "template",
     "key": "customParamsFormat",
     "value": "DATA_LAYER"
    },
    {
     "type": "template",
     "key": "dataLayerVariable",
     "value": "{{e}}"
    }
   ],
   "type": "sp"
  }

其中 customParamFormat = USER_SPECIFIED

{
   "name": "Sample Google Ads Remarketing",
   "liveOnly": false,
   "parameter": [
    {
     "type": "template",
     "key": "googleConversionId",
     "value": "{{c}}"
    },
    {
     "type": "template",
     "key": "googleConversionLabel",
     "value": "MyLabel"
    },
    {
     "type": "template",
     "key": "customParamsFormat",
     "value": "USER_SPECIFIED"
    },
    {
     "type": "list",
     "key": "googleCustomParams",
     "list": [
      {
       "type": "map",
       "map": [
        {
         "type": "template",
         "key": "key",
         "value": "key2"
        },
        {
         "type": "template",
         "key": "value",
         "value": "World"
        }
       ]
      },
      {
       "type": "map",
       "map": [
        {
         "type": "template",
         "key": "key",
         "value": "key1"
        },
        {
         "type": "template",
         "key": "value",
         "value": "Hello"
        }
       ]
      }
     ]
    }
   ],
   "type": "sp"
  }

Turn Data Collection

类型代码

tdc

参数
类型 备注
customerId template
categoryId template 可选。
keyword template 可选。
dataProviderId template 可选。
optOut template 可选。
示例
{
   "name": "Sample Turn Data Collection Tag",
   "liveOnly": false,
   "parameter": [
    {
     "type": "template",
     "key": "customerId",
     "value": "{{a}}"
    },
    {
     "type": "template",
     "key": "categoryId",
     "value": "myCategoryId"
    },
    {
     "type": "template",
     "key": "keyword",
     "value": "myKeyword"
    },
    {
     "type": "template",
     "key": "dataProviderId",
     "value": "myDataProviderId"
    },
    {
     "type": "template",
     "key": "optOut",
     "value": "myOptOut"
    }
   ],
   "type": "tdc"
  }

请参阅移动代码部分中的 Google Ads 转化跟踪

Marin Software

类型代码

ms

参数
类型 备注
type template TRACK_PAGEVIEWTRACK_TRANSACTION
clientId template
anonymizeIp boolean 可选。
conversionType template 适用于 type = TRACK_TRANSACTION
useDataLayer boolean 适用于 type = TRACK_TRANSACTION
orderId template 适用于 useDataLayer = false
product template 适用于 useDataLayer = false
price template 适用于 useDataLayer = false
category template 适用于 useDataLayer = false
quantity template 适用于 useDataLayer = false
currencyCode template 适用于 useDataLayer = false
示例

其中 type=TRACK_PAGEVIEW

{
   "name": "Sample Marin Software Tag",
   "liveOnly": false,
   "parameter": [
    {
     "type": "template",
     "key": "type",
     "value": "TRACK_PAGEVIEW"
    },
    {
     "type": "template",
     "key": "clientId",
     "value": "Client ID"
    },
    {
     "type": "boolean",
     "key": "anonymizeIp",
     "value": "false"
    }
   ],
   "type": "ms"
  }

其中 type = TRACK_TRANSACTIONuseDataLayer = true

{
   "name": "Sample Marin Software Tag",
   "liveOnly": false,
   "parameter": [
    {
     "type": "template",
     "key": "type",
     "value": "TRACK_TRANSACTION"
    },
    {
     "type": "template",
     "key": "clientId",
     "value": "Client ID"
    },
    {
     "type": "template",
     "key": "conversionType",
     "value": "myConversionType"
    },
    {
     "type": "boolean",
     "key": "anonymizeIp",
     "value": "false"
    },
    {
     "type": "boolean",
     "key": "useDataLayer",
     "value": "true"
    }
   ],
   "type": "ms"
  }

其中 type = TRACK_TRANSACTIONuseDataLayer = false

{
   "name": "Sample Marin Software Tag",
   "liveOnly": false,
   "parameter": [
    {
     "type": "template",
     "key": "type",
     "value": "TRACK_TRANSACTION"
    },
    {
     "type": "template",
     "key": "clientId",
     "value": "Client ID"
    },
    {
     "type": "template",
     "key": "conversionType",
     "value": "myConversionType"
    },
    {
     "type": "boolean",
     "key": "anonymizeIp",
     "value": "false"
    },
    {
     "type": "template",
     "key": "orderId",
     "value": "myOrderId"
    },
    {
     "type": "template",
     "key": "product",
     "value": "myProduct"
    },
    {
     "type": "template",
     "key": "price",
     "value": "myPrice"
    },
    {
     "type": "template",
     "key": "category",
     "value": "myCategory"
    },
    {
     "type": "template",
     "key": "quantity",
     "value": "myQuantity"
    },
    {
     "type": "template",
     "key": "currencyCode",
     "value": "myCurrencyCode"
    },
    {
     "type": "boolean",
     "key": "useDataLayer",
     "value": "false"
    }
   ],
   "type": "ms"
  }

受众群体

AdAdvisor

类型代码

_ta

参数
类型
subscriberId template
示例
  {
   "name": "Sample AdAdvisor Tag",
   "liveOnly": false,
   "parameter": [
    {
     "type": "template",
     "key": "subscriberId",
     "value": "{{a}}"
    }
   ],
   "type": "_ta",
  }

Bizo Insight

类型代码

bzi

参数
示例

Dstillery Universal Pixel

类型代码

m6d

参数
 {
   "name": "Sample Bizo Insight Tag",
   "liveOnly": false,
   "parameter": [
    {
     "type": "template",
     "key": "id",
     "value": "{{a}}"
    },
    {
     "type": "template",
     "key": "title",
     "value": "myTitle"
    },
    {
     "type": "template",
     "key": "domain",
     "value": "myDomain"
    },
    {
     "type": "template",
     "key": "company",
     "value": "myCompany"
    },
    {
     "type": "template",
     "key": "location",
     "value": "myLocation"
    },
    {
     "type": "template",
     "key": "employeeRange",
     "value": "myEmployeeRange"
    },
    {
     "type": "template",
     "key": "standardIndustrialClassification",
     "value": "mySICS"
    },
    {
     "type": "template",
     "key": "email",
     "value": "myEmail"
    }
   ],
   "type": "bzi"
  }
类型 备注
id template
title template 可选。
domain template 可选。
company template 可选。
location template 可选。
employeeRange template 可选。
standardIndustrialClassification template 可选。
email template 可选。
类型 备注
pixelId template
pixelCheckValue template
orderId template 可选。
revenue template 可选。
namespaceId template
namespaceCheckValue template
namespaceCode template
示例
  {
   "name": "Sample Dstillery Pixel Tag",
   "liveOnly": false,
   "parameter": [
    {
     "type": "template",
     "key": "pixelId",
     "value": "{{a}}"
    },
    {
     "type": "template",
     "key": "pixelCheckValue",
     "value": "{{a}}"
    },
    {
     "type": "template",
     "key": "orderId",
     "value": "myOrderId"
    },
    {
     "type": "template",
     "key": "revenue",
     "value": "myRevenue"
    },
    {
     "type": "template",
     "key": "namespaceId",
     "value": "{{a}}"
    },
    {
     "type": "template",
     "key": "namespaceCheckValue",
     "value": "{{a}}"
    },
    {
     "type": "template",
     "key": "namespaceCode",
     "value": "{{a}}"
    }
   ],
   "type": "m6d"
  }

VisualDNA 转化代码

类型代码

vdc

参数
类型 说明
apiAccountKey template
conversionId template
identitySyncPlatformCode template 可选。
示例
  {
   "name": "Sample Visual DNA Conversion Tag",
   "liveOnly": false,
   "parameter": [
    {
     "type": "template",
     "key": "apiAccountKey",
     "value": "{{a}}"
    },
    {
     "type": "template",
     "key": "conversionId",
     "value": "{{a}}"
    },
    {
     "type": "template",
     "key": "identitySyncPlatformCode",
     "value": "mySyncPlatformCode"
    }
   ],
   "type": "vdc"
  }

Analytics

Universal Analytics

类型代码

ua

参数
类型 备注
trackingId template
type template TRACK_PAGEVIEWTRACK_EVENTTRACK_TRANSACTIONTRACK_SOCIALTRACK_TIMINGDECORATE_LINKDECORATE_FORM 中的一个。
contentGroup list 可选。映射列表,每个映射都有一个 index 键和一个 group 键。
dimension list 可选。映射列表,每个映射都有一个 index 键和一个 dimension 键。
metric list 可选。映射列表,每个映射都有一个 index 键和一个 metric 键。
functionName template 可选。
fieldsToSet map 可选。列表中的每个参数都是一个映射;每个映射参数都应有两个子参数:一个子参数的键为 fieldName,另一个子参数的键为 value。以下字段现在仅可使用 fieldsToSet 访问:anonymizeIp、sessionControl、referrer、page、title(以前称为 documentTitle)、cookieName、cookieDomain、sampleRate、cookieExpires(以前称为 cookieExpiration)、cookiePath、forceSSL(以前称为 forceSsl)、allowLinker。
doubleClick boolean 可选。
trackerName template 可选。当 setTrackerName == true 时,可以指定 trackerName
useDebugVersion boolean 可选。
autoLinkDomains template 可选。可为 TRACK_PAGEVIEW 指定该字段。
linkId template 可选。启用增强的链接归因。
decorateFormsAutoLink boolean 可选。可为 TRACK_PAGEVIEW 指定该字段。
setTrackerName boolean 可选。
useHashAutoLink boolean 可选。
enableEcommerce boolean 可选。
useEcommerceDataLayer boolean 可选。只能为 eventType=TRACK_EVENT 和/或 TRACK_PAGEVIEW 指定。
ecommerceMacroData template 可选。只能在 useEcommerceDataLayer=false 时为 eventType=TRACK_EVENT 和/或 TRACK_PAGEVIEW 指定。
eventCategory template 适用于 eventType=TRACK_EVENT
eventAction template 适用于 eventType=TRACK_EVENT
eventLabel template 适用于 eventType=TRACK_EVENT
eventValue template 适用于 eventType=TRACK_EVENT
nonInteraction template 适用于 eventType=TRACK_EVENT
socialNetwork template 适用于 eventType=TRACK_SOCIAL
socialAction template 适用于 eventType=TRACK_SOCIAL
socialActionTarget template 适用于 eventType=TRACK_SOCIAL
timingVar template 适用于 eventType=TRACK_TIMING
timingCategory template 适用于 eventType=TRACK_TIMING
timingLabel template 适用于 eventType=TRACK_TIMING
timingValue template 适用于 eventType=TRACK_TIMING
useHashDecorateLink boolean 适用于 eventType=DECORATE_LINK
useHashDecorateForm boolean 适用于 eventType=DECORATE_FORM
示例

其中 trackType=TRACK_PAGEVIEW

 {
   "name": "Sample Universal Analytics",
   "liveOnly": false,
   "parameter": [
    {
     "type": "template",
     "key": "trackingId",
     "value": "UA-00000-123"
    },
    {
     "type": "template",
     "key": "trackType",
     "value": "TRACK_PAGEVIEW"
    },
    {
     "type": "list",
     "key": "contentGroup",
     "list": [
      {
       "type": "map",
       "map": [
        {
         "type": "template",
         "key": "index",
         "value": "1"
        },
        {
         "type": "template",
         "key": "group",
         "value": "myContentGroup"
        }
       ]
      }
     ]
    },
    {
     "type": "list",
     "key": "dimension",
     "list": [
      {
       "type": "map",
       "map": [
        {
         "type": "template",
         "key": "index",
         "value": "1"
        },
        {
         "type": "template",
         "key": "dimension",
         "value": "myCustomDimension"
        }
       ]
      }
     ]
    },
    {
     "type": "list",
     "key": "metric",
     "list": [
      {
       "type": "map",
       "map": [
        {
         "type": "template",
         "key": "index",
         "value": "1"
        },
        {
         "type": "template",
         "key": "metric",
         "value": "myCustomMetric"
        }
       ]
      }
     ]
    },
    {
     "type": "list",
     "key": "fieldsToSet",
     "list": [
      {
       "type": "map",
       "map": [
        {
         "type": "template",
         "key": "fieldName",
         "value": "myFieldName"
        },
        {
         "type": "template",
         "key": "value",
         "value": "myFieldValue"
        }
       ]
      },
      {
       "type": "map",
       "map": [
        {
         "type": "template",
         "key": "fieldName",
         "value": "anonymizeIp"
        },
        {
         "type": "template",
         "key": "value",
         "value": "true"
        }
       ]
      },
      {
       "type": "map",
       "map": [
        {
         "type": "template",
         "key": "fieldName",
         "value": "allowLinker"
        },
        {
         "type": "template",
         "key": "value",
         "value": "true"
        }
       ]
      },
      {
       "type": "map",
       "map": [
        {
         "type": "template",
         "key": "fieldName",
         "value": "sessionControl"
        },
        {
         "type": "template",
         "key": "value",
         "value": "mySessionControl"
        }
       ]
      },
      {
       "type": "map",
       "map": [
        {
         "type": "template",
         "key": "fieldName",
         "value": "referrer"
        },
        {
         "type": "template",
         "key": "value",
         "value": "myDocReferrer"
        }
       ]
      },
      {
       "type": "map",
       "map": [
        {
         "type": "template",
         "key": "fieldName",
         "value": "page"
        },
        {
         "type": "template",
         "key": "value",
         "value": "myDocPath"
        }
       ]
      },
      {
       "type": "map",
       "map": [
        {
         "type": "template",
         "key": "fieldName",
         "value": "title"
        },
        {
         "type": "template",
         "key": "value",
         "value": "myDocTitle"
        }
       ]
      },
      {
       "type": "map",
       "map": [
        {
         "type": "template",
         "key": "fieldName",
         "value": "sampleRate"
        },
        {
         "type": "template",
         "key": "value",
         "value": "mySampleRate"
        }
       ]
      },
      {
       "type": "map",
       "map": [
        {
         "type": "template",
         "key": "fieldName",
         "value": "cookieName"
        },
        {
         "type": "template",
         "key": "value",
         "value": "myCookieName"
        }
       ]
      },
      {
       "type": "map",
       "map": [
        {
         "type": "template",
         "key": "fieldName",
         "value": "cookieDomain"
        },
        {
         "type": "template",
         "key": "value",
         "value": "myCookieDomain"
        }
       ]
      },
      {
       "type": "map",
       "map": [
        {
         "type": "template",
         "key": "fieldName",
         "value": "cookiePath"
        },
        {
         "type": "template",
         "key": "value",
         "value": "myCookiePath"
        }
       ]
      },
      {
       "type": "map",
       "map": [
        {
         "type": "template",
         "key": "fieldName",
         "value": "cookieExpires"
        },
        {
         "type": "template",
         "key": "value",
         "value": "myCookieExpirationInSeconds"
        }
       ]
      }
     ]
    },
    {
     "type": "template",
     "key": "trackerName",
     "value": "myCustomTrackerName"
    },
    {
     "type": "boolean",
     "key": "useDebugVersion",
     "value": "false"
    },
    {
     "type": "template",
     "key": "autoLinkDomains",
     "value": "myAutoLinkDomain"
    },
    {
     "type": "boolean",
     "key": "linkId",
     "value": "false"
    },
    {
     "type": "boolean",
     "key": "decorateFormsAutoLink",
     "value": "false"
    },
    {
     "type": "boolean",
     "key": "setTrackerName",
     "value": "true"
    },
    {
     "type": "boolean",
     "key": "useHashAutoLink",
     "value": "false"
    },
    {
     "type": "boolean",
     "key": "enableEcommerce",
     "value": "false"
    }
   ],
   "type": "ua"
  }

其中 trackType=TRACK_EVENT

 {
   "name": "Sample Universal Analytics",
   "liveOnly": false,
   "parameter": [
    {
     "type": "template",
     "key": "trackingId",
     "value": "UA-00000-123"
    },
    {
     "type": "template",
     "key": "trackType",
     "value": "TRACK_EVENT"
    },
    {
     "type": "template",
     "key": "eventCategory",
     "value": "myCategory"
    },
    {
     "type": "template",
     "key": "eventAction",
     "value": "myAction"
    },
    {
     "type": "template",
     "key": "eventLabel",
     "value": "myLabel"
    },
    {
     "type": "template",
     "key": "eventValue",
     "value": "myValue"
    },
   "type": "ua"
   }

其中 trackType=TRACK_TRANSACTION

  {
   "name": "Sample Universal Analytics",
   "liveOnly": false,
   "parameter": [
    {
     "type": "template",
     "key": "trackingId",
     "value": "UA-00000-123"
    },
    {
     "type": "template",
     "key": "trackType",
     "value": "TRACK_TRANSACTION"
    }
   ],
   "type": "ua"
  }

其中 trackType=TRACK_SOCIAL

 {
   "name": "Sample Universal Analytics",
   "liveOnly": false,
   "parameter": [
    {
     "type": "template",
     "key": "trackingId",
     "value": "UA-00000-123"
    },
    {
     "type": "template",
     "key": "trackType",
     "value": "TRACK_SOCIAL"
    },
    {
     "type": "template",
     "key": "socialNetwork",
     "value": "myNetwork"
    },
    {
     "type": "template",
     "key": "socialAction",
     "value": "myAction"
    },
    {
     "type": "template",
     "key": "socialActionTarget",
     "value": "myActionTarget"
    }
   ],
   "type": "ua"
  }

其中 trackType=TRACK_TIMING

 {
   "name": "Sample Universal Analytics",
   "liveOnly": false,
   "parameter": [
    {
     "type": "template",
     "key": "trackingId",
     "value": "UA-00000-123"
    },
    {
     "type": "template",
     "key": "trackType",
     "value": "TRACK_TIMING"
    },
    {
     "type": "template",
     "key": "timingVar",
     "value": "myVar"
    },
    {
     "type": "template",
     "key": "timingCategory",
     "value": "myCategory"
    },
    {
     "type": "template",
     "key": "timingLabel",
     "value": "myLabel"
    },
    {
     "type": "template",
     "key": "timingValue",
     "value": "myValue"
    }
   ],
   "type": "ua"
  }

其中 trackType=DECORATE_LINK

 {
   "name": "Sample Universal Analytics",
   "liveOnly": false,
   "parameter": [
    {
     "type": "template",
     "key": "trackingId",
     "value": "UA-00000-123"
    },
    {
     "type": "template",
     "key": "trackType",
     "value": "DECORATE_LINK"
    },
    {
     "type": "boolean",
     "key": "useHashDecorateLink",
     "value": "false"
    }
   ],
   "type": "ua"
  }

其中 trackType=DECORATE_FORM

  {
   "name": "Sample Universal Analytics",
   "liveOnly": false,
   "parameter": [
    {
     "type": "template",
     "key": "trackingId",
     "value": "UA-00000-123"
    },
    {
     "type": "template",
     "key": "trackType",
     "value": "DECORATE_FORM"
    },
    {
     "type": "boolean",
     "key": "useHashDecorateForm",
     "value": "false"
    }
   ],
   "type": "ua"
  }

传统 Google Analytics

类型代码

ga

参数
类型 备注
webPropertyId template
type template 以下各项中的一项:TRACK_PAGEVIEWTRACK_EVENTLINK, LINK_BY_POST, TRACK_TRANSACTION, TRACK_SOCIAL, TRACK_TIMING, DECORATE_LINK, DECORATE_FORM
siteSpeedSampleRate template 结果应为数字百分比值 (0..100)。
cookiePath template
page template
domainName template
allowLinker boolean
sampleRate integer 值介于 0 到 100 之间
campaignCookieTimeout template 结果应为表示超时的数值(以毫秒为单位)。
allowAnchor boolean
sessionCookieTimeout template 结果应为表示超时的数值(以毫秒为单位)。
doubleClick boolean
hitCallback template
ignoredRef list 要忽略的引荐来源网址列表。
ignoredRef[].value template 引荐来源网址的名称
customVar list 映射列表。每个自定义变量一个映射。
customVar[].slot integer
customVar[].name template
customVar[].value template
customVar[].scope integer 1 表示匹配级范围,2 表示会话级范围,3 表示用户级范围。
organic list
organic[].searchEngine template
organic[].queryParamName template
organic[].prepend boolean
ignoredOrganic list 要忽略的关键字列表。
ignoredOrganic[].value template 要忽略的关键字。
title template
campaignSourceOverride template
campaignMediumOverride template
campaignTermOverride template
campaignContentOverride template
campaignNameOverride template
anonymizeIp boolean
linkId boolean 可选。启用增强的链接归因。
contentGroup list 映射列表。
contentGroup[].index template 结果必须为整数。
contentGroup[].group template 群组名称。
campContentKey template
campMediumKey template
campNameKey template
campNoKey template
campSourceKey template
campTermKey template
campaignTrack boolean
clientInfo template
detectFlash template
detectTitle template
localGifPath template
sendHitstToGoogle template
referrerOverride template
visitorCookieTimeout template 毫秒数。
trackerName template
cookiePathCopy list Cookie 路径列表。
cookiePathCopy[].value template Cookie 路径。
useDebugVersion boolean
forceSsl boolean
setTrackerName boolean
eventCategory template 适用于 trackType=TRACK_EVENT
eventAction template 适用于 trackType=TRACK_EVENT
eventLabel template 适用于 trackType=TRACK_EVENT
eventValue template 适用于 trackType=TRACK_EVENT
nonInteraction boolean 适用于 trackType=TRACK_EVENT
targetUrl template 适用于 trackType=LINK
useHashLink boolean 适用于 trackType=LINK
formObject template 适用于 trackType=LINK_BY_POST
useHashLinkByPost boolean 适用于 trackType=LINK_BY_POST
currencyCode template 可选。适用于 trackType=TRACK_TRANSACTION
socialUseDataLayer boolean 可选。适用于 trackType=TRACK_SOCIAL
socialNetwork template 适用于 trackType=TRACK_SOCIALsocialUseDataLayer=false
socialAction template 适用于 trackType=TRACK_SOCIALsocialUseDataLayer=false
socialPagePath template 可选。适用于 trackType=TRACK_SOCIAL
socialTarget template 适用于 trackType=TRACK_SOCIALsocialUseDataLayer=false
timingCategory template 适用于 trackType=TRACK_TIMING
timingVariable template 适用于 trackType=TRACK_TIMING
timingTime template 适用于 trackType=TRACK_TIMING
timingLabel template 适用于 trackType=TRACK_TIMING
timingSampleRate template 适用于 trackType=TRACK_TIMING
useHashDecorateLink boolean 适用于 trackType=DECORATE_LINK
useHashDecorateForm boolean 适用于 trackType=DECORATE_FORM
示例

其中 trackType=TRACK_PAGEVIEW

 {
   "name": "Sample Classic Google Analytics",
   "liveOnly": false,
   "parameter": [
    {
     "type": "template",
     "key": "webPropertyId",
     "value": "UA-00000-123"
    },
    {
     "type": "template",
     "key": "siteSpeedSampleRate",
     "value": "{{sampleRatePercent}}"
    },
    {
     "type": "template",
     "key": "cookiePath",
     "value": "myCookiePath"
    },
    {
     "type": "template",
     "key": "trackType",
     "value": "TRACK_PAGEVIEW"
    },
    {
     "type": "template",
     "key": "page",
     "value": "myVirtualPagePath"
    },
    {
     "type": "template",
     "key": "domainName",
     "value": "myDomainName"
    },
    {
     "type": "boolean",
     "key": "allowLinker",
     "value": "true"
    },
    {
     "type": "integer",
     "key": "sampleRate",
     "value": "10"
    },
    {
     "type": "template",
     "key": "campaignCookieTimeout",
     "value": "{{timeoutInMilli}}"
    },
    {
     "type": "boolean",
     "key": "allowAnchor",
     "value": "true"
    },
    {
     "type": "template",
     "key": "sessionCookieTimeout",
     "value": "{{timeoutInMilli}}"
    },
    {
     "type": "boolean",
     "key": "doubleClick",
     "value": "true"
    },
    {
     "type": "list",
     "key": "ignoredRef",
     "list": [
      {
       "type": "template",
       "value": "referrer1Ignore"
      },
      {
       "type": "template",
       "value": "referrer2Ignore"
      }
     ]
    },
    {
     "type": "list",
     "key": "customVar",
     "list": [
      {
       "type": "map",
       "map": [
        {
         "type": "integer",
         "key": "slot",
         "value": "1"
        },
        {
         "type": "template",
         "key": "name",
         "value": "myCustomVar"
        },
        {
         "type": "template",
         "key": "value",
         "value": "myCustomVarValue"
        },
        {
         "type": "integer",
         "key": "scope",
         "value": "3"
        }
       ]
      }
     ]
    },
    {
     "type": "list",
     "key": "organic",
     "list": [
      {
       "type": "map",
       "map": [
        {
         "type": "template",
         "key": "searchEngine",
         "value": "myOrganicSearchEngine"
        },
        {
         "type": "template",
         "key": "queryParamName",
         "value": "mySearchQueryParamName"
        },
        {
         "type": "boolean",
         "key": "prepend",
         "value": "true"
        }
       ]
      }
     ]
    },
    {
     "type": "list",
     "key": "ignoredOrganic",
     "list": [
      {
       "type": "template",
       "value": "keyword1Ignore"
      },
      {
       "type": "template",
       "value": "keyword2Ignore"
      }
     ]
    },
    {
     "type": "template",
     "key": "title",
     "value": "myPageTitle"
    },
    {
     "type": "template",
     "key": "campaignSourceOverride",
     "value": "mySourceOverride"
    },
    {
     "type": "template",
     "key": "campaignMediumOverride",
     "value": "myMediumOverride"
    },
    {
     "type": "template",
     "key": "campaignTermOverride",
     "value": "myTermOverride"
    },
    {
     "type": "template",
     "key": "campaignContentOverride",
     "value": "myContentOverride"
    },
    {
     "type": "template",
     "key": "campaignNameOverride",
     "value": "myNameOverride"
    },
    {
     "type": "boolean",
     "key": "anonymizeIp",
     "value": "true"
    },
    {
     "type": "boolean",
     "key": "linkId",
     "value": "false"
    },
    {
     "type": "list",
     "key": "contentGroup",
     "list": [
      {
       "type": "map",
       "map": [
        {
         "type": "template",
         "key": "index",
         "value": "1"
        },
        {
         "type": "template",
         "key": "group",
         "value": "myContentGroup1"
        }
       ]
      }
     ]
    },
    {
     "type": "template",
     "key": "campContentKey",
     "value": "myContentKey"
    },
    {
     "type": "template",
     "key": "campMediumKey",
     "value": "myMediumKey"
    },
    {
     "type": "template",
     "key": "campNameKey",
     "value": "myNameKey"
    },
    {
     "type": "template",
     "key": "campNoKey",
     "value": "myNoOverrideKey"
    },
    {
     "type": "template",
     "key": "campSourceKey",
     "value": "mySourceKey"
    },
    {
     "type": "template",
     "key": "campTermKey",
     "value": "myTermKey"
    },
    {
     "type": "boolean",
     "key": "campaignTrack",
     "value": "true"
    },
    {
     "type": "boolean",
     "key": "clientInfo",
     "value": "true"
    },
    {
     "type": "boolean",
     "key": "detectFlash",
     "value": "true"
    },
    {
     "type": "boolean",
     "key": "detectTitle",
     "value": "true"
    },
    {
     "type": "template",
     "key": "localGifPath",
     "value": "myLocalGIFPath"
    },
    {
     "type": "boolean",
     "key": "sendHitsToGoogle",
     "value": "true"
    },
    {
     "type": "template",
     "key": "referrerOverride",
     "value": "myReferrerOverride"
    },
    {
     "type": "template",
     "key": "visitorCookieTimeout",
     "value": "{{timeoutInMilli}}"
    },
    {
     "type": "template",
     "key": "trackerName",
     "value": "myTrackerName"
    },
    {
     "type": "list",
     "key": "cookiePathCopy",
     "list": [
      {
       "type": "template",
       "value": "/path/to/cookies1"
      },
      {
       "type": "template",
       "value": "/path/to/cookies2"
      }
     ]
    },
    {
     "type": "boolean",
     "key": "useDebugVersion",
     "value": "false"
    },
    {
     "type": "boolean",
     "key": "forceSsl",
     "value": "false"
    },
    {
     "type": "boolean",
     "key": "setTrackerName",
     "value": "true"
    }
   ],
   "type": "ga"
  }

其中 trackType=TRACK_EVENT

 {
   "name": "Sample Classic Google Analytics",
   "liveOnly": false,
   "parameter": [
    {
     "type": "template",
     "key": "webPropertyId",
     "value": "UA-00000-123"
    },
    {
     "type": "template",
     "key": "trackType",
     "value": "TRACK_EVENT"
    },
    {
     "type": "template",
     "key": "eventCategory",
     "value": "myCategory"
    },
    {
     "type": "template",
     "key": "eventAction",
     "value": "myAction"
    },
    {
     "type": "template",
     "key": "eventLabel",
     "value": "myLabel"
    },
    {
     "type": "template",
     "key": "eventValue",
     "value": "myValue"
    },
    {
     "type": "boolean",
     "key": "nonInteraction",
     "value": "false"
    }
   ],
   "type": "ga"
  }

其中 trackType=LINK

 {
   "name": "Sample Classic Google Analytics",
   "liveOnly": false,
   "parameter": [
    {
     "type": "template",
     "key": "webPropertyId",
     "value": "UA-00000-123"
    },
    {
     "type": "template",
     "key": "trackType",
     "value": "LINK"
    },
    {
     "type": "template",
     "key": "targetUrl",
     "value": "TargetURL"
    },
    {
     "type": "boolean",
     "key": "useHashLink",
     "value": "false"
    }
   ],
   "type": "ga"
  }

其中 trackType=LINK_BY_POST

 {
   "name": "Sample Classic Google Analytics",
   "liveOnly": false,
   "parameter": [
    {
     "type": "template",
     "key": "webPropertyId",
     "value": "UA-00000-123"
    },
    {
     "type": "template",
     "key": "trackType",
     "value": "LINK_BY_POST"
    },
    {
     "type": "template",
     "key": "formObject",
     "value": "{{a}}"
    },
    {
     "type": "boolean",
     "key": "useHashLinkByPost",
     "value": "false"
    }
   ],
   "type": "ga"
  }

其中 trackType=TRACK_TRANSACTION

 {
   "name": "Sample Classic Google Analytics",
   "liveOnly": false,
   "parameter": [
    {
     "type": "template",
     "key": "webPropertyId",
     "value": "UA-00000-123"
    },
    {
     "type": "template",
     "key": "trackType",
     "value": "TRACK_TRANSACTION"
    },
    {
     "type": "template",
     "key": "currencyCode",
     "value": "{{a}}"
    }
   ]
   "type": "ga"
  }

其中 trackType=TRACK_SOCIAL

 {
   "name": "Sample Classic Google Analytics",
   "liveOnly": false,
   "parameter": [
    {
     "type": "template",
     "key": "webPropertyId",
     "value": "UA-00000-123"
    },
    {
     "type": "template",
     "key": "trackType",
     "value": "TRACK_SOCIAL"
    },
    {
     "type": "template",
     "key": "socialNetwork",
     "value": "mySocialNetwork"
    },
    {
     "type": "template",
     "key": "socialAction",
     "value": "mySocialAction"
    },
    {
     "type": "template",
     "key": "socialTarget",
     "value": "myTarget"
    },
    {
     "type": "template",
     "key": "socialPagePath",
     "value": "myPagePaht"
    }
   ],
   "type": "ga"
  }

其中 trackType=TRACK_TIMING

 {
   "name": "Sample Classic Google Analytics",
   "liveOnly": false,
   "parameter": [
    {
     "type": "template",
     "key": "webPropertyId",
     "value": "UA-00000-123"
    },
    {
     "type": "template",
     "key": "trackType",
     "value": "TRACK_TIMING"
    },
    {
     "type": "template",
     "key": "timingCategory",
     "value": "myCategory"
    },
    {
     "type": "template",
     "key": "timingVariable",
     "value": "myVariable"
    },
    {
     "type": "template",
     "key": "timingTime",
     "value": "myTime"
    },
    {
     "type": "template",
     "key": "timingLabel",
     "value": "myLabel"
    },
    {
     "type": "template",
     "key": "timingSampleRate",
     "value": "{{sampleRatePercent}}"
    }
   ],
   "type": "ga"
  }

其中 trackType=DECORATE_LINK

 {
   "name": "Sample Classic Google Analytics",
   "liveOnly": false,
   "parameter": [
    {
     "type": "template",
     "key": "webPropertyId",
     "value": "UA-00000-123"
    },
    {
     "type": "template",
     "key": "trackType",
     "value": "DECORATE_LINK"
    },
    {
     "type": "boolean",
     "key": "useHashDecorateLink",
     "value": "false"
    }
   ],
   "type": "ga"
  }

其中 trackType=DECORATE_FORM

 {
   "name": "Sample Classic Google Analytics",
   "liveOnly": false,
   "parameter": [
    {
     "type": "template",
     "key": "webPropertyId",
     "value": "UA-00000-123"
    },
    {
     "type": "template",
     "key": "trackType",
     "value": "DECORATE_LINK"
    },
    {
     "type": "boolean",
     "key": "useHashDecorateForm",
     "value": "false"
    }
   ],
   "type": "ga"
  }

ClickTale Standard

类型代码

cts

参数
类型
projectId template
sampleRate template
partition template
示例
 {
   "name": "Sample ClickTale Standard Tracking",
   "liveOnly": false,
   "parameter": [
    {
     "type": "template",
     "key": "projectId",
     "value": "{{a}}"
    },
    {
     "type": "template",
     "key": "sampleRate",
     "value": "{{a}}"
    },
    {
     "type": "template",
     "key": "partition",
     "value": "{{a}}"
    }
   ],
   "type": "cts"
  }

comScore Unified Digital Measurement

类型代码

csm

参数
类型
clientId template
示例
 {
   "name": "Sample comScore Unified Digital Measurement",
   "liveOnly": false,
   "parameter": [
    {
     "type": "template",
     "key": "clientId",
     "value": "{{a}}"
    }
   ],
   "type": "csm"
  }

移动代码

Google Ads 转化跟踪

类型代码

awct

参数
类型
googleConversionId template
googleConversionLabel template
googleConversionValue template
示例
{
  "liveOnly": false,
  "name": "Google Ads Conversion Tracking",
  "parameter": [
    {
      "key": "googleConversionId",
      "type": "template",
      "value": "{{a}}"
    },
    {
      "key": "googleConversionLabel",
      "type": "template",
      "value": "{{a}}"
    },
    {
      "key": "googleConversionValue",
      "type": "template",
      "value": "{{a}}"
    }
  ],
  "tagId": "1",
  "type": "awct"
}

Google Ads 再营销

类型代码

sp

参数
类型 备注
googleConversionId template
googleConversionLabel template
customParamsFormat template DATA_LAYERUSER_SPECIFIED
googleScreenName template 可选。
dataLayerVariable template 适用于 customParamsFormat=DATA_LAYER;应引用数据层变量宏。
googleCustomParams list 映射列表,每个映射都有一个 [keyvalue] 条目。 适用于 customParamsFormat=USER_SPECIFIED
googleCustomParams[].key template
googleCustomParams[].value template
示例

其中 customParamsFormat=USER_SPECIFIED

{
  "accountId": "103020",
  "containerId": "666282",
  "firingRuleId": [
    "1"
  ],
  "liveOnly": false,
  "name": "Google Ads Remarketing",
  "parameter": [
    {
      "key": "conversionId",
      "type": "template",
      "value": "cvid"
    },
    {
      "key": "conversionLabel",
      "type": "template",
      "value": "cvl"
    },
    {
      "key": "customParamsFormat",
      "type": "template",
      "value": "USER_SPECIFIED"
    },
    {
      "key": "customParams",
      "list": [
        {
          "map": [
            {
              "key": "key",
              "type": "template",
              "value": "cpk1"
            },
            {
              "key": "value",
              "type": "template",
              "value": "cpv1"
            }
          ],
          "type": "map"
        }
      ],
      "type": "list"
    }
  ],
  "tagId": "2",
  "type": "sp"
}

其中 customParamsFormat=DATA_LAYER

{
  "accountId": "103020",
  "containerId": "666282",
  "firingRuleId": [
    "1"
  ],
  "liveOnly": false,
  "name": "Google Ads Remarketing DataLayer",
  "parameter": [
    {
      "key": "conversionId",
      "type": "template",
      "value": "cvid"
    },
    {
      "key": "conversionLabel",
      "type": "template",
      "value": "cvl"
    },
    {
      "key": "customParamsFormat",
      "type": "template",
      "value": "DATA_LAYER"
    },
    {
      "key": "dataLayerVariable",
      "type": "template",
      "value": "{{dlv}}"
    }
  ],
  "tagId": "3",
  "type": "sp"
}

Floodlight 计数器

类型代码

flc

参数
类型 备注
ordinalType template STANDARDUNIQUESESSION 中的一个
advertiserId template
groupTag template
activityTag template
customVariable list [keyvalue] 对
userVariable template 代码的 u= 变量。
transactionVariable template 代码的 tran= 变量。
sessionId template 指定 ordinalType 是否为 SESSION
useImageTag boolean
unrepeatable boolean 可选。
示例

其中 ordinalType=STANDARD

{
  "accountId": "103020",
  "containerId": "666282",
  "firingRuleId": [
    "1"
  ],
  "liveOnly": false,
  "name": "Floodlight Counter",
  "parameter": [
    {
      "key": "ordinalType",
      "type": "template",
      "value": "STANDARD"
    },
    {
      "key": "advertiserId",
      "type": "template",
      "value": "42"
    },
    {
      "key": "groupTag",
      "type": "template",
      "value": "gts"
    },
    {
      "key": "activityTag",
      "type": "template",
      "value": "ats"
    },
    {
      "key": "useImageTag",
      "type": "boolean",
      "value": "false"
    },
    {
      "key": "customVariable",
      "list": [
        {
          "map": [
            {
              "key": "key",
              "type": "template",
              "value": "u3"
            },
            {
              "key": "value",
              "type": "template",
              "value": "bar"
            }
          ],
          "type": "map"
        },
        {
          "map": [
            {
              "key": "key",
              "type": "template",
              "value": "u1"
            },
            {
              "key": "value",
              "type": "template",
              "value": "foo"
            }
          ],
          "type": "map"
        }
      ],
      "type": "list"
    },
    {
      "key": "userVariable",
      "type": "template",
      "value": "u"
    },
    {
      "key": "transactionVariable",
      "type": "template",
      "value": "tran"
    }
  ],
  "tagId": "4",
  "type": "flc"
}

其中 ordinalType=SESSION

{
  "accountId": "103020",
  "containerId": "666282",
  "firingRuleId": [
    "1"
  ],
  "liveOnly": false,
  "name": "Floodlight Counter Per Session",
  "parameter": [
    {
      "key": "ordinalType",
      "type": "template",
      "value": "SESSION"
    },
    {
      "key": "advertiserId",
      "type": "template",
      "value": "42"
    },
    {
      "key": "groupTag",
      "type": "template",
      "value": "gts"
    },
    {
      "key": "activityTag",
      "type": "template",
      "value": "ats"
    },
    {
      "key": "sessionId",
      "type": "template",
      "value": "session-id"
    },
    {
      "key": "useImageTag",
      "type": "boolean",
      "value": "false"
    },
    {
      "key": "customVariable",
      "type": "list"
    },
    {
      "key": "userVariable",
      "type": "template",
      "value": "u"
    },
    {
      "key": "transactionVariable",
      "type": "template",
      "value": "tran"
    }
  ],
  "tagId": "5",
  "type": "flc"
}

Floodlight 销售

类型代码

fls

参数
类型 备注
countingMethod template TRANSACTIONSITEM_SOLD
advertiserId template
groupTag template
activityTag template
revenue template
orderId template 指定 countingMethod 是否为 ITEM_SOLD
customVariable map 映射列表,每个映射都有一个 [keyvalue] 对。 映射项键为介于 u1u20 之间;映射项类型为“模板”。
userVariable template 代码的 u= 变量。
transactionVariable template 代码的 tran= 变量。
quantity template 指定 countingMethod 是否为 ITEM_SOLD
useImageTag boolean
unrepeatable boolean 可选。
示例

其中 countingMethod=TRANSACTIONS

{
  "accountId": "103020",
  "containerId": "666282",
  "firingRuleId": [
    "1"
  ],
  "liveOnly": false,
  "name": "Floodlight Sales",
  "parameter": [
    {
      "key": "countingMethod",
      "type": "template",
      "value": "TRANSACTIONS"
    },
    {
      "key": "advertiserId",
      "type": "template",
      "value": "42"
    },
    {
      "key": "groupTag",
      "type": "template",
      "value": "gts"
    },
    {
      "key": "activityTag",
      "type": "template",
      "value": "ats"
    },
    {
      "key": "revenue",
      "type": "template",
      "value": "{{revenue}}"
    },
    {
      "key": "orderId",
      "type": "template",
      "value": "oid"
    },
    {
      "key": "useImageTag",
      "type": "boolean",
      "value": "false"
    },
    {
      "key": "customVariable",
      "map": [
        {
          "key": "u1",
          "type": "template",
          "value": "jio"
        }
      ],
      "type": "map"
    },
    {
      "key": "userVariable",
      "type": "template",
      "value": "u"
    },
    {
      "key": "transactionVariable",
      "type": "template",
      "value": "tran"
    }
  ],
  "tagId": "6",
  "type": "fls"
}

其中 countingMethod=ITEM_SOLD

{
  "accountId": "103020",
  "containerId": "666282",
  "firingRuleId": [
    "1"
  ],
  "liveOnly": false,
  "name": "Floodlight Sales Item Sold",
  "parameter": [
    {
      "key": "countingMethod",
      "type": "template",
      "value": "ITEM_SOLD"
    },
    {
      "key": "advertiserId",
      "type": "template",
      "value": "42"
    },
    {
      "key": "groupTag",
      "type": "template",
      "value": "gts"
    },
    {
      "key": "activityTag",
      "type": "template",
      "value": "ats"
    },
    {
      "key": "quantity",
      "type": "template",
      "value": "1"
    },
    {
      "key": "revenue",
      "type": "template",
      "value": "{{revenue}}"
    },
    {
      "key": "orderId",
      "type": "template",
      "value": "oid"
    },
    {
      "key": "useImageTag",
      "type": "boolean",
      "value": "false"
    },
    {
      "key": "customVariable",
      "map": [
        {
          "key": "u1",
          "type": "template",
          "value": "ji"
        }
      ],
      "type": "map"
    },
    {
      "key": "userVariable",
      "type": "template",
      "value": "u"
    },
    {
      "key": "transactionVariable",
      "type": "template",
      "value": "tran"
    }
  ],
  "tagId": "7",
  "type": "fls"
}

函数调用

类型代码

_fc

参数
类型 备注
functionName template
functionArgument map 映射列表,每个映射都有一个 [keyvalue] 对。
示例
{
  "accountId": "103020",
  "containerId": "666282",
  "firingRuleId": [
    "1"
  ],
  "liveOnly": false,
  "name": "Function Call",
  "parameter": [
    {
      "key": "functionName",
      "type": "template",
      "value": "fn"
    },
    {
      "key": "functionArgument",
      "map": [
        {
          "key": "argkey1",
          "type": "template",
          "value": "argval1"
        }
      ],
      "type": "map"
    }
  ],
  "tagId": "8",
  "type": "_fc"
}

Universal Analytics

类型代码

ua

参数
类型 备注
trackingId template
type template 以下各项中的一项:TRACK_APPVIEWTRACK_EVENTTRACK_SOCIALTRACK_TIMINGTRACK_EXCEPTION
contentGroup list 列表中的每个参数都是一个映射;每个映射参数都应有两个子参数:一个子参数的键为 index,另一个子参数的键为 group
dimension list 列表中的每个参数都是一个映射;每个映射参数都应有两个子参数:一个子参数的键为 index,另一个子参数的键为 dimension
metric list 列表中的每个参数都是一个映射;每个映射参数都应有两个子参数:一个子参数的键为 index,另一个子参数的键为 metric
fieldsToSet list 可选。列表中的每个参数都是一个映射;每个映射参数都应有两个子参数:一个子参数的键为 fieldName,另一个子参数的键为 value。以下字段现在仅可使用 fieldsToSet 访问:anonymizeIp、sessionControl、appName、appVersion、screenName(以前称为 contentDescription)、sampleRate。
nonInteraction booleantemplate 适用于 trackType=TRACK_EVENT
eventCategory template 适用于 trackType=TRACK_EVENT
eventAction template 适用于 trackType=TRACK_EVENT
eventLabel template 适用于 trackType=TRACK_EVENT
eventValue template 适用于 trackType=TRACK_EVENT
socialNetwork template 适用于 trackType=TRACK_SOCIAL
socialAction template 适用于 trackType=TRACK_SOCIAL
socialActionTarget template 适用于 trackType=TRACK_SOCIAL
timingVar template 适用于 trackType=TRACK_TIMING
timingCategory template 适用于 trackType=TRACK_TIMING
timingLabel template 适用于 trackType=TRACK_TIMING
timingValue template 适用于 trackType=TRACK_TIMING
exceptionDescription template 适用于 trackType=TRACK_EXCEPTION
exceptionFatal booleantemplate 适用于 eventType=TRACK_EXCEPTION。如果类型为 template,则值应引用计算结果为 boolean 的宏。
示例

其中 trackType=TRACK_APPVIEW

{
  "accountId": "103020",
  "containerId": "666282",
  "liveOnly": false,
  "name": "Universal Analytics App View",
  "parameter": [
    {
      "key": "trackingId",
      "type": "template",
      "value": "UA-123-1"
    },
    {
      "key": "trackType",
      "type": "template",
      "value": "TRACK_APPVIEW"
    },
    {
      "key": "contentGroup",
      "list": [
        {
          "map": [
            {
              "key": "index",
              "type": "template",
              "value": "0"
            },
            {
              "key": "group",
              "type": "template",
              "value": "cg0"
            }
          ],
          "type": "map"
        }
      ],
      "type": "list"
    },
    {
      "key": "dimension",
      "list": [
        {
          "map": [
            {
              "key": "index",
              "type": "template",
              "value": "0"
            },
            {
              "key": "dimension",
              "type": "template",
              "value": "dim0"
            }
          ],
          "type": "map"
        }
      ],
      "type": "list"
    },
    {
      "key": "metric",
      "list": [
        {
          "map": [
            {
              "key": "index",
              "type": "template",
              "value": "0"
            },
            {
              "key": "metric",
              "type": "template",
              "value": "cm0"
            }
          ],
          "type": "map"
        }
      ],
      "type": "list"
    },
    {
      "key": "fieldsToSet",
      "list": [
        {
          "map": [
            {
              "key": "fieldName",
              "type": "template",
              "value": "fn0"
            },
            {
              "key": "value",
              "type": "template",
              "value": "fv0"
            }
          ],
          "type": "map"
        },
        {
          "map": [
            {
             "type": "template",
             "key": "fieldName",
             "value": "anonymizeIp"
            },
            {
             "type": "template",
             "key": "value",
             "value": "true"
            }
          ],
          "type": "map"
        },
        {
          "map": [
            {
             "type": "template",
             "key": "fieldName",
             "value": "appName"
            },
            {
             "type": "template",
             "key": "value",
             "value": "myApp"
            }
          ],
          "type": "map"
        },
        {
          "map": [
            {
             "type": "template",
             "key": "fieldName",
             "value": "sessionControl"
            },
            {
             "type": "template",
             "key": "value",
             "value": "mySessionControl"
            }
          ],
          "type": "map"
        }
      ],
      "type": "list"
    }
  ],
  "tagId": "9",
  "type": "ua"
}

其中 trackType=TRACK_EVENT

{
  "accountId": "103020",
  "containerId": "666282",
  "liveOnly": false,
  "name": "Universal Analytics Event",
  "parameter": [
    {
      "key": "trackingId",
      "type": "template",
      "value": "UA-123-1"
    },
    {
      "key": "trackType",
      "type": "template",
      "value": "TRACK_EVENT"
    },
    {
      "key": "nonInteraction",
      "type": "boolean",
      "value": "true"
    },
    {
      "key": "contentGroup",
      "type": "list"
    },
    {
      "key": "dimension",
      "type": "list"
    },
    {
      "key": "metric",
      "type": "list"
    },
    {
      "key": "fieldsToSet",
      "type": "list"
    },
    {
      "key": "eventCategory",
      "type": "template",
      "value": "cat"
    },
    {
      "key": "eventAction",
      "type": "template",
      "value": "act"
    },
    {
      "key": "eventLabel",
      "type": "template",
      "value": "label"
    },
    {
      "key": "eventValue",
      "type": "template",
      "value": "value"
    }
  ],
  "tagId": "10",
  "type": "ua"
}

其中 trackType=TRACK_SOCIAL

{
  "accountId": "103020",
  "containerId": "666282",
  "liveOnly": false,
  "name": "Universal Analytics Social",
  "parameter": [
    {
      "key": "trackingId",
      "type": "template",
      "value": "UA-123-1"
    },
    {
      "key": "trackType",
      "type": "template",
      "value": "TRACK_SOCIAL"
    },
    {
      "key": "contentGroup",
      "type": "list"
    },
    {
      "key": "dimension",
      "type": "list"
    },
    {
      "key": "metric",
      "type": "list"
    },
    {
      "key": "fieldsToSet",
      "type": "list"
    },
    {
      "key": "socialNetwork",
      "type": "template",
      "value": "network"
    },
    {
      "key": "socialAction",
      "type": "template",
      "value": "action"
    },
    {
      "key": "socialActionTarget",
      "type": "template",
      "value": "action-target"
    }
  ],
  "tagId": "11",
  "type": "ua"
}

其中 trackType=TRACK_TIMING

{
  "accountId": "103020",
  "containerId": "666282",
  "liveOnly": false,
  "name": "Universal Analytics Timing",
  "parameter": [
    {
      "key": "trackingId",
      "type": "template",
      "value": "UA-123-1"
    },
    {
      "key": "trackType",
      "type": "template",
      "value": "TRACK_TIMING"
    },
    {
      "key": "contentGroup",
      "type": "list"
    },
    {
      "key": "dimension",
      "type": "list"
    },
    {
      "key": "metric",
      "type": "list"
    },
    {
      "key": "fieldsToSet",
      "type": "list"
    },
    {
      "key": "timingVar",
      "type": "template",
      "value": "var"
    },
    {
      "key": "timingCategory",
      "type": "template",
      "value": "cat"
    },
    {
      "key": "timingLabel",
      "type": "template",
      "value": "label"
    },
    {
      "key": "timingValue",
      "type": "template",
      "value": "value"
    }
  ],
  "tagId": "12",
  "type": "ua"
}

其中 trackType=TRACK_EXCEPTION

{
  "accountId": "103020",
  "containerId": "666282",
  "liveOnly": false,
  "name": "Universal Analytics Exception",
  "parameter": [
    {
      "key": "trackingId",
      "type": "template",
      "value": "UA-123-1"
    },
    {
      "key": "trackType",
      "type": "template",
      "value": "TRACK_EXCEPTION"
    },
    {
      "key": "contentGroup",
      "type": "list"
    },
    {
      "key": "dimension",
      "type": "list"
    },
    {
      "key": "metric",
      "type": "list"
    },
    {
      "key": "fieldsToSet",
      "type": "list"
    },
    {
      "key": "exceptionDescription",
      "type": "template",
      "value": "description"
    },
    {
      "key": "exceptionFatal",
      "type": "boolean",
      "value": "true"
    }
  ],
  "tagId": "13",
  "type": "ua"
}

自定义图片代码

类型代码

img

参数
类型 备注
useCacheBuster boolean 不允许使用宏。
url template
cacheBusterQueryParam template
示例
{
  "accountId": "103020",
  "containerId": "666282",
  "firingRuleId": [
    "1"
  ],
  "liveOnly": false,
  "name": "Custom Image Tag",
  "parameter": [
    {
      "key": "useCacheBuster",
      "type": "boolean",
      "value": "true"
    },
    {
      "key": "url",
      "type": "template",
      "value": "http://www.example.com"
    },
    {
      "key": "cacheBusterQueryParam",
      "type": "template",
      "value": "gtmcb"
    }
  ],
  "tagId": "14",
  "type": "img"
}