Built-In Variables: create

建立一或多個 GTM 內建變數。 立即試用

要求

HTTP 要求

POST https://www.googleapis.com/tagmanager/v2/+parent/built_in_variables

參數

參數名稱 說明
路徑參數
parent string GTM Workspace 的 API 相對路徑。 範例: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}
選用的查詢參數
type string 要啟用的內建變數類型。

可接受的值為:
  • advertiserId
  • advertisingTrackingEnabled
  • ampBrowserLanguage
  • ampCanonicalHost
  • ampCanonicalPath
  • ampCanonicalUrl
  • ampClientId
  • ampClientMaxScrollX
  • ampClientMaxScrollY
  • ampClientScreenHeight
  • ampClientScreenWidth
  • ampClientScrollX
  • ampClientScrollY
  • ampClientTimestamp
  • ampClientTimezone
  • ampGtmEvent
  • ampPageDownloadTime
  • ampPageLoadTime
  • ampPageViewId
  • ampReferrer
  • ampTitle
  • ampTotalEngagedTime
  • appId
  • appName
  • appVersionCode
  • appVersionName
  • builtInVariableTypeUnspecified
  • clickClasses
  • clickElement
  • clickId
  • clickTarget
  • clickText
  • clickUrl
  • clientName
  • containerId
  • containerVersion
  • debugMode
  • deviceName
  • elementVisibilityFirstTime
  • elementVisibilityRatio
  • elementVisibilityRecentTime
  • elementVisibilityTime
  • environmentName
  • errorLine
  • errorMessage
  • errorUrl
  • event
  • eventName
  • firebaseEventParameterCampaign
  • firebaseEventParameterCampaignAclid
  • firebaseEventParameterCampaignAnid
  • firebaseEventParameterCampaignClickTimestamp
  • firebaseEventParameterCampaignContent
  • firebaseEventParameterCampaignCp1
  • firebaseEventParameterCampaignGclid
  • firebaseEventParameterCampaignSource
  • firebaseEventParameterCampaignTerm
  • firebaseEventParameterCurrency
  • firebaseEventParameterDynamicLinkAcceptTime
  • firebaseEventParameterDynamicLinkLinkid
  • firebaseEventParameterNotificationMessageDeviceTime
  • firebaseEventParameterNotificationMessageId
  • firebaseEventParameterNotificationMessageName
  • firebaseEventParameterNotificationMessageTime
  • firebaseEventParameterNotificationTopic
  • firebaseEventParameterPreviousAppVersion
  • firebaseEventParameterPreviousOsVersion
  • firebaseEventParameterPrice
  • firebaseEventParameterProductId
  • firebaseEventParameterQuantity
  • firebaseEventParameterValue
  • firstPartyServingUrl
  • formClasses
  • formElement
  • formId
  • formTarget
  • formText
  • formUrl
  • historySource
  • htmlId
  • language
  • newHistoryFragment
  • newHistoryState
  • newHistoryUrl
  • oldHistoryFragment
  • oldHistoryState
  • oldHistoryUrl
  • osVersion
  • pageHostname
  • pagePath
  • pageUrl
  • platform
  • queryString
  • randomNumber
  • referrer
  • requestMethod
  • requestPath
  • resolution
  • scrollDepthDirection
  • scrollDepthThreshold
  • scrollDepthUnits
  • sdkVersion
  • serverPageLocationHostname
  • serverPageLocationPath
  • serverPageLocationUrl
  • videoCurrentTime
  • videoDuration
  • videoPercent
  • videoProvider
  • videoStatus
  • videoTitle
  • videoUrl
  • videoVisible
  • visitorRegion

授權

此要求需要具有下列範圍的授權:

範圍
https://www.googleapis.com/auth/tagmanager.edit.containers

詳情請參閱「驗證與授權」網頁。

要求主體

請勿使用這個方法提供請求主體。

回應

如果成功的話,這個方法會傳回回應內文,其結構如下:

{
  "builtInVariable": [
    {
      "path": string,
      "accountId": string,
      "containerId": string,
      "workspaceId": string,
      "type": string,
      "name": string
    }
  ]
}
屬性名稱 說明 附註
builtInVariable[] list 已建立的內建變數清單。
builtInVariable[].path string GTM BuiltInVariable 的 API 相對路徑。
builtInVariable[].accountId string GTM 帳戶 ID。
builtInVariable[].containerId string GTM 容器 ID。
builtInVariable[].workspaceId string GTM 工作區 ID。
builtInVariable[].type string 內建變數類型。

可接受的值為:
  • advertiserId
  • advertisingTrackingEnabled
  • ampBrowserLanguage
  • ampCanonicalHost
  • ampCanonicalPath
  • ampCanonicalUrl
  • ampClientId
  • ampClientMaxScrollX
  • ampClientMaxScrollY
  • ampClientScreenHeight
  • ampClientScreenWidth
  • ampClientScrollX
  • ampClientScrollY
  • ampClientTimestamp
  • ampClientTimezone
  • ampGtmEvent
  • ampPageDownloadTime
  • ampPageLoadTime
  • ampPageViewId
  • ampReferrer
  • ampTitle
  • ampTotalEngagedTime
  • appId
  • appName
  • appVersionCode
  • appVersionName
  • builtInVariableTypeUnspecified
  • clickClasses
  • clickElement
  • clickId
  • clickTarget
  • clickText
  • clickUrl
  • clientName
  • containerId
  • containerVersion
  • debugMode
  • deviceName
  • elementVisibilityFirstTime
  • elementVisibilityRatio
  • elementVisibilityRecentTime
  • elementVisibilityTime
  • environmentName
  • errorLine
  • errorMessage
  • errorUrl
  • event
  • eventName
  • firebaseEventParameterCampaign
  • firebaseEventParameterCampaignAclid
  • firebaseEventParameterCampaignAnid
  • firebaseEventParameterCampaignClickTimestamp
  • firebaseEventParameterCampaignContent
  • firebaseEventParameterCampaignCp1
  • firebaseEventParameterCampaignGclid
  • firebaseEventParameterCampaignSource
  • firebaseEventParameterCampaignTerm
  • firebaseEventParameterCurrency
  • firebaseEventParameterDynamicLinkAcceptTime
  • firebaseEventParameterDynamicLinkLinkid
  • firebaseEventParameterNotificationMessageDeviceTime
  • firebaseEventParameterNotificationMessageId
  • firebaseEventParameterNotificationMessageName
  • firebaseEventParameterNotificationMessageTime
  • firebaseEventParameterNotificationTopic
  • firebaseEventParameterPreviousAppVersion
  • firebaseEventParameterPreviousOsVersion
  • firebaseEventParameterPrice
  • firebaseEventParameterProductId
  • firebaseEventParameterQuantity
  • firebaseEventParameterValue
  • firstPartyServingUrl
  • formClasses
  • formElement
  • formId
  • formTarget
  • formText
  • formUrl
  • historySource
  • htmlId
  • language
  • newHistoryFragment
  • newHistoryState
  • newHistoryUrl
  • oldHistoryFragment
  • oldHistoryState
  • oldHistoryUrl
  • osVersion
  • pageHostname
  • pagePath
  • pageUrl
  • platform
  • queryString
  • randomNumber
  • referrer
  • requestMethod
  • requestPath
  • resolution
  • scrollDepthDirection
  • scrollDepthThreshold
  • scrollDepthUnits
  • sdkVersion
  • serverPageLocationHostname
  • serverPageLocationPath
  • serverPageLocationUrl
  • videoCurrentTime
  • videoDuration
  • videoPercent
  • videoProvider
  • videoStatus
  • videoTitle
  • videoUrl
  • videoVisible
  • visitorRegion
builtInVariable[].name string 參照內建變數的內建變數名稱。

試試看!

使用下方的 APIs Explorer,針對即時資料呼叫這個方法,看看會有什麼結果。