ActivityMap.regionIDAttribute

ActivityMap.regionIDAttribute變數可讓您變更Activity Map在判斷Activity Map地區維度時尋找的屬性。 如果網站的結構化方式讓id屬性對Activity Map區域不那麼有用,您可以設定此變數來檢視其他屬性。

Web SDK擴充功能中的地區ID屬性

當​ 啟用點選資料集合 ​啟用時,請使用​ 篩選點選屬性 ​回呼程式碼區塊。 在此程式碼區塊中,您可以檢查content.clickedElement的值,然後變更值或放棄連結追蹤資料的集合。

Web SDK JavaScript資料庫中的地區ID屬性

啟用clickCollectionEnabled時,請在clickCollection物件中使用filterClickDetails回呼。 在此回呼內,您可以檢查clickedElement的值,並自訂所收集區域的邏輯。

alloy("configure", {
  clickCollectionEnabled: true,
  clickCollection: {
    filterClickDetails: function(content) {
      // If the clicked element was in a table, set the region to the contents of the data-custom attribute
      // If the clicked element was not in a table, or if the data-custom attribute doesn't exist, leave region as-is
      content.region = content.clickedElement.closest('table')?.getAttribute('data-custom') || content.region;
    }
  }
});

使用Adobe Analytics擴充功能的地區ID屬性

Adobe Analytics 擴充功能中沒有專用欄位可使用這個變數。請依照 AppMeasurement 語法使用自訂程式碼編輯器。

使用AppMeasurement的s.ActivityMap.regionIDAttribute

s.ActivityMap.regionIDAttribute變數是字串,代表決定Activity Map地區維度的屬性。 此變數預設為id。 如果您變更此變數,Activity Map將不再尋找id屬性,但仍會尋找其他條件來判斷區域(例如語意元素)。

<script>
  var s = s_gi("examplersid");
  s.ActivityMap.regionIDAttribute = "data-custom";
</script>

<!-- Clicking any of these links populates the region dimension with 'left-nav' -->
<div id="676967617A656C6C65" data-custom="left-nav">
  <a href="index.html">Home</a>
  <a href="products.html">View our products</a>
  <a href="contact.html">Contact us</a>
</div>
recommendation-more-help
b4f6d761-4a8b-4322-b801-c85b9e3be690