Workspaces: sync

Đồng bộ hoá không gian làm việc với phiên bản vùng chứa mới nhất bằng cách cập nhật tất cả các thực thể không gian làm việc chưa được sửa đổi và hiển thị xung đột cho các thực thể đã sửa đổi. Thử ngay.

Yêu cầu

Yêu cầu HTTP

POST https://www.googleapis.com/tagmanager/v2/+path:sync

Thông số

Tên thông số Giá trị Nội dung mô tả
Tham số đường dẫn
path string Đường dẫn tương đối cho API của GTM Workspace. Ví dụ: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}

Ủy quyền

Yêu cầu này cần được cho phép có phạm vi sau:

Phạm vi
https://www.googleapis.com/auth/tagmanager.edit.containers

Để biết thêm thông tin, hãy xem trang xác thực và uỷ quyền.

Nội dung yêu cầu

Đừng cung cấp nội dung yêu cầu bằng phương thức này.

Phản hồi

Nếu thành công, phương thức này sẽ trả về nội dung phản hồi có cấu trúc như sau:

{
  "syncStatus": {
    "mergeConflict": boolean,
    "syncError": boolean
  },
  "mergeConflict": [
    {
      "entityInWorkspace": {
        "tag": accounts.containers.workspaces.tags Resource,
        "trigger": accounts.containers.workspaces.triggers Resource,
        "variable": accounts.containers.workspaces.variables Resource,
        "folder": accounts.containers.workspaces.folders Resource,
        "client": accounts.containers.workspaces.clients Resource,
        "transformation": accounts.containers.workspaces.transformations Resource,
        "zone": accounts.containers.workspaces.zones Resource,
        "customTemplate": accounts.containers.workspaces.templates Resource,
        "builtInVariable": {
          "path": string,
          "accountId": string,
          "containerId": string,
          "workspaceId": string,
          "type": string,
          "name": string
        },
        "gtagConfig": accounts.containers.workspaces.gtag_config Resource,
        "changeStatus": string
      },
      "entityInBaseVersion": {
        "tag": accounts.containers.workspaces.tags Resource,
        "trigger": accounts.containers.workspaces.triggers Resource,
        "variable": accounts.containers.workspaces.variables Resource,
        "folder": accounts.containers.workspaces.folders Resource,
        "client": accounts.containers.workspaces.clients Resource,
        "transformation": accounts.containers.workspaces.transformations Resource,
        "zone": accounts.containers.workspaces.zones Resource,
        "customTemplate": accounts.containers.workspaces.templates Resource,
        "builtInVariable": {
          "path": string,
          "accountId": string,
          "containerId": string,
          "workspaceId": string,
          "type": string,
          "name": string
        },
        "gtagConfig": accounts.containers.workspaces.gtag_config Resource,
        "changeStatus": string
      }
    }
  ]
}
Tên tài sản Giá trị Nội dung mô tả Ghi chú
syncStatus nested object Cho biết liệu quá trình đồng bộ hoá có gây ra xung đột hợp nhất hoặc lỗi đồng bộ hoá hay không.
syncStatus.mergeConflict boolean Hoạt động đồng bộ hoá đã phát hiện thấy xung đột hợp nhất.
syncStatus.syncError boolean Đã xảy ra lỗi trong quá trình đồng bộ hoá.
mergeConflict[] list Xung đột hợp nhất sau khi đồng bộ hoá. Nếu trường này không trống, thì quá trình đồng bộ hoá vẫn được coi là thành công. Tuy nhiên, bạn sẽ không thể tạo phiên bản cho đến khi giải quyết xong tất cả xung đột.
mergeConflict[].entityInWorkspace nested object Thực thể không gian làm việc có các thay đổi gây mâu thuẫn so với phiên bản cơ sở. Nếu một thực thể bị xoá trong không gian làm việc, thì thực thể đó vẫn sẽ xuất hiện với trạng thái thay đổi đã bị xoá.
mergeConflict[].entityInWorkspace.tag nested object Thẻ do thực thể đại diện.
mergeConflict[].entityInWorkspace.trigger nested object Điều kiện kích hoạt do thực thể đại diện.
mergeConflict[].entityInWorkspace.variable nested object Biến do thực thể đại diện.
mergeConflict[].entityInWorkspace.folder nested object Thư mục mà thực thể đại diện.
mergeConflict[].entityInWorkspace.changeStatus string Biểu thị cách thực thể được thay đổi trong không gian làm việc.

Các giá trị được chấp nhận là:
  • "added"
  • "changeStatusUnspecified"
  • "deleted"
  • "none"
  • "updated"
mergeConflict[].entityInBaseVersion nested object Thực thể phiên bản cơ sở (kể từ lần đồng bộ hoá mới nhất) có các thay đổi gây mâu thuẫn so với không gian làm việc. Nếu thiếu trường này thì tức là thực thể không gian làm việc đã bị xoá khỏi phiên bản cơ sở.
mergeConflict[].entityInBaseVersion.tag nested object Thẻ do thực thể đại diện.
mergeConflict[].entityInBaseVersion.trigger nested object Điều kiện kích hoạt do thực thể đại diện.
mergeConflict[].entityInBaseVersion.variable nested object Biến do thực thể đại diện.
mergeConflict[].entityInBaseVersion.folder nested object Thư mục mà thực thể đại diện.
mergeConflict[].entityInBaseVersion.changeStatus string Biểu thị cách thực thể được thay đổi trong không gian làm việc.

Các giá trị được chấp nhận là:
  • "added"
  • "changeStatusUnspecified"
  • "deleted"
  • "none"
  • "updated"
mergeConflict[].entityInWorkspace.client nested object Ứng dụng do thực thể đại diện.
mergeConflict[].entityInBaseVersion.client nested object Ứng dụng do thực thể đại diện.
mergeConflict[].entityInWorkspace.transformation nested object Phép biến đổi do thực thể biểu thị.
mergeConflict[].entityInBaseVersion.transformation nested object Phép biến đổi do thực thể biểu thị.
mergeConflict[].entityInWorkspace.zone nested object Vùng được đại diện bởi thực thể.
mergeConflict[].entityInWorkspace.customTemplate nested object Mẫu tuỳ chỉnh do thực thể đại diện.
mergeConflict[].entityInWorkspace.builtInVariable nested object Biến tích hợp được biểu thị bằng thực thể.
mergeConflict[].entityInWorkspace.builtInVariable.path string Đường dẫn liên quan đến API của BuildInVariable của GTM.
mergeConflict[].entityInWorkspace.builtInVariable.accountId string Mã tài khoản GTM.
mergeConflict[].entityInWorkspace.builtInVariable.containerId string Mã vùng chứa Trình quản lý thẻ của Google (GTM).
mergeConflict[].entityInWorkspace.builtInVariable.workspaceId string Mã không gian làm việc của Trình quản lý thẻ của Google (GTM).
mergeConflict[].entityInWorkspace.builtInVariable.type string Loại biến tích hợp.

Các giá trị được chấp nhận là:
  • "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"
mergeConflict[].entityInWorkspace.builtInVariable.name string Tên của biến tích hợp được dùng để tham chiếu đến biến tích hợp.
mergeConflict[].entityInWorkspace.gtagConfig nested object Cấu hình gtag đang được thực thể đại diện.
mergeConflict[].entityInBaseVersion.zone nested object Vùng được đại diện bởi thực thể.
mergeConflict[].entityInBaseVersion.customTemplate nested object Mẫu tuỳ chỉnh do thực thể đại diện.
mergeConflict[].entityInBaseVersion.builtInVariable nested object Biến tích hợp được biểu thị bằng thực thể.
mergeConflict[].entityInBaseVersion.builtInVariable.path string Đường dẫn liên quan đến API của BuildInVariable của GTM.
mergeConflict[].entityInBaseVersion.builtInVariable.accountId string Mã tài khoản GTM.
mergeConflict[].entityInBaseVersion.builtInVariable.containerId string Mã vùng chứa Trình quản lý thẻ của Google (GTM).
mergeConflict[].entityInBaseVersion.builtInVariable.workspaceId string Mã không gian làm việc của Trình quản lý thẻ của Google (GTM).
mergeConflict[].entityInBaseVersion.builtInVariable.type string Loại biến tích hợp.

Các giá trị được chấp nhận là:
  • "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"
mergeConflict[].entityInBaseVersion.builtInVariable.name string Tên của biến tích hợp được dùng để tham chiếu đến biến tích hợp.
mergeConflict[].entityInBaseVersion.gtagConfig nested object Cấu hình gtag đang được thực thể đại diện.

Hãy dùng thử!

Hãy sử dụng APIs Explorer (Trình khám phá API) bên dưới để gọi phương thức này trên dữ liệu trực tiếp và xem phản hồi.