[英]Custom Javascript variable in Google Tag Manager and dataLayer
[英]Google Tag Manager - custom javascript to extract dataLayer variable
喏,給你:
["Name:code, Desc:whatever desc is, the first desc basically", "Name:auto, Desc:the second description"] .map(function(obj){return obj.split(/, desc:/i).slice(-1)[0]}).join(",")
第一行只是我試圖重現您在 DLV 中的內容以進行測試。 第二行是您必須對 DLV 執行的操作,因此您的自定義 jsvascript 變量中的實際代碼將類似於以下內容:
function(){ return {{dlv - ecommerce.purchase.actionField.coupon}}.map(function(obj){return obj.split(/, desc:/i).slice(-1)[0]}).join(","); }
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.