Util.cookieRead

Cookie可以儲存和擷取相同網域上各頁面的資訊。使用 Util.cookieRead() 方法可從 Cookie 擷取值。

使用Adobe Analytics擴充功能和Web SDK擴充功能讀取Cookie

您可以透過在資料元素中設定值來讀取 Cookie。

  1. 使用您的 AdobeID 認證登入 Adobe Experience Platform 資料彙集
  2. 按一下所需的標籤屬性。
  3. 前往資料元素標記,然後按一下所需的資料元素 (或建立資料元素)。
  4. 設定 副檔名 下拉式清單至 核心,以及 資料元素型別 至 Cookie.
  5. 在文字欄位中輸入 Cookie 名稱。

Cookie 值會儲存在資料元素中。接著,您可以參考規則中的資料元素,以指派所需的變數。

AppMeasurement和Analytics擴充功能自訂程式碼編輯器中的s.Util.cookieRead()

呼叫 s.Util.cookieRead() 方法以讀取所需的 Cookie 值。其唯一引數是必要的字串。此方法會傳回包含 Cookie 值的字串。如果 Cookie 不存在,則會傳回空字串。

// Reads the value set in the cookie named 'example' and assigns the value to eVar1
s.eVar1 = s.Util.cookieRead("example");
recommendation-more-help
b4f6d761-4a8b-4322-b801-c85b9e3be690