{"success":true,"message":"ok","data":{"siteId":158,"tagRecId":150,"domRecList":[],"ssidRecList":[],"fetchCookieList":{"apd_account":"siteMember"},"urlFetchMap":{"URL_PARAM":[],"URL_LAST_PATH":"OFF"},"outlinkFilter":[],"tagExternalList":[{"name":"ad2-Cookie-Sync","triggerList":[{"type":"PAGE_VIEW","urlPatternList":[{"key":"surveycake.com","isGetAttribute":false}],"urlRegexList":[],"triggerDomList":[]}],"type":"OTHER","status":"ON","codeSnippet":"<script>\n  // 定義變數 a 的值，方便日後修改\n  const trackingParamA = 158; \n\n  // Function to get cookie value\n  function getCookieValue(cookieName) {\n    const cookieArray = document.cookie.split(';');\n\n    for (let i = 0; i < cookieArray.length; i++) {\n      let cookie = cookieArray[i].trim();\n      if (cookie.indexOf(cookieName + '=') === 0) {\n        return cookie.substring(cookieName.length + 1, cookie.length);\n      }\n    }\n\n    return null;\n  }\n\n  // Function to call the pixel\n  function callPixel() {\n    const retuid = getCookieValue('__retuid');\n    if (retuid) {\n      const img = new Image();\n      img.src = `https://cm.ad2iction.com/sync?ad2_pid=dac&ad2_tpi=1&ad2_puid=${retuid}i&a=${trackingParamA}&ckType=6`;\n      img.style.display = 'none';\n      document.body.appendChild(img);\n      \n      console.debug(`Pixel called successfully with a=${trackingParamA}`);\n      console.debug(img.src);\n    } else {\n      console.debug('__retuid cookie not found');\n    }\n  }\n\n  // Call the pixel when the script runs\n  callPixel();\n</script>","memo":"NOIFRAME","pushStatus":"ALL"},{"name":"91App Tacking","triggerList":[{"type":"PAGE_VIEW","urlPatternList":[{"key":"surveycake.com","isGetAttribute":false}],"urlRegexList":[],"triggerDomList":[]}],"type":"OTHER","status":"ON","codeSnippet":"<script>\n    (function() {\n        // 取得 Cookie 的函數\n        function getCookie(name) {\n            //console.log('getCookie');\n            const match = document.cookie.match(new RegExp('(?:^|;\\\\s*)' + name + '=([^;]*)'));\n            return match ? match[1] : null;\n        }\n\n        // 取得 cid 的函數（從 Cookie 讀取 __retuid）\n        function getCustomerId() {\n            return new Promise((resolve, reject) => {\n                //console.log('In calling getCustomerId');\n                const retuidValue = getCookie('__retuid'); // __retuid 即為 cid\n\n                if (retuidValue) {\n                    console.debug('CID found:', retuidValue);\n                    resolve(retuidValue);\n                } else {\n                    console.warn('CID not found');\n                    reject('CID not found in cookies');\n                }\n            });\n        }\n\n        // 非同步載入 91App Tracking SDK\n        function load91AppSDK() {\n            return new Promise((resolve, reject) => {\n                var script = document.createElement(\"script\");\n                script.src = \"https://tracking-client.91app.com/1.2.0/nineyi.tracking.client.iife.js\";\n                script.async = true;\n\n                script.onload = function() {\n                    console.debug(\"Tracking SDK Loaded\");\n                    resolve();\n                };\n\n                script.onerror = function() {\n                    reject(\"Tracking SDK failed to load\");\n                };\n\n                document.head.appendChild(script);\n            });\n        }\n\n        // 執行 91App Tracking 初始化\n        function initialize91AppTracking() {\n            return getCustomerId()\n                .then(cid => {\n                    //console.log('Successfully retrieved CID:', cid);\n                    return window.nineyiTracking.initialize({\n                        cid,\n                        tid: '3',\n                        idStoredType: \"COOKIE\",\n                    });\n                })\n                .then(initialStatus => {\n                    if (initialStatus === \"SUCCESS\") {\n                        console.debug(\"Tracking initialized successfully\");\n                    } else {\n                        console.debug(\"Tracking initialization failed\");\n                    }\n                })\n                .catch(error => {\n                    console.error('Error initializing tracking:', error);\n                });\n        }\n\n        // 同步 91 ID，確保在 Tracking 初始化後執行\n        function sync91ID() {\n        return new Promise((resolve, reject) => {\n        setTimeout(() => {\n            const id91Value = getCookie('nineyi_did');\n            const trackingParamA = 158; // 抽出的變數，方便修改\n\n            if (id91Value) {\n                const apiUrl = `https://a.amnet.tw/cksync/common/?a=${trackingParamA}&ckType=21&otherId=${encodeURIComponent(id91Value)}`;\n                \n                // 使用 fetch 確保請求成功發送\n                fetch(apiUrl, { method: \"GET\", mode: \"no-cors\", credentials: \"include\" })\n                    .then(() => {\n                        console.debug(`91 ID sync request sent successfully (a=${trackingParamA}):`, apiUrl);\n                        resolve();\n                    })\n                    .catch(error => {\n                        console.error(`91 ID sync request failed (a=${trackingParamA}):`, apiUrl, error);\n                        reject(error);\n                    });\n            } else {\n                console.warn('nineyi_did not found in cookies');\n                resolve(); // 即使找不到 Cookie 也 resolve，避免影響後續流程\n            }\n        }, 100); // 延遲 100ms 確保 tracking 初始化後再執行\n    });\n}\n\n        \n\n        // 依序執行步驟\n        load91AppSDK()\n            .then(() => initialize91AppTracking()) // 初始化 Tracking\n            .then(() => sync91ID()) // Tracking 初始化完成後執行 91 ID 同步\n            .catch(error => {\n                console.error(\"Error in tracking process:\", error);\n            });\n\n    })();\n</script>","memo":"NOIFRAME","pushStatus":"ALL"},{"name":"UC-Cookie-Sync2","triggerList":[{"type":"PAGE_VIEW","urlPatternList":[{"key":"surveycake.com","isGetAttribute":false}],"urlRegexList":[],"triggerDomList":[]}],"type":"OTHER","status":"ON","codeSnippet":"<img src=\"https://sync.aralego.com/idsync?redirect=https%3A%2F%2Fa.amnet.tw%2Fcksync%2Fcommon%2F%3FckType%3D12%26otherId%3DUCFUID%26a%3D158%26t%3D\" style=\"display:none;\"><script src=\"//ads.aralego.com/cookiesync\"></script>","memo":"IFRAME","pushStatus":"ALL"},{"name":"測試mail作Member cookiesync","triggerList":[{"type":"CLICK","urlPatternList":[],"urlRegexList":[],"triggerDomList":[{"key":"div[aria-label=\"submit\"] > button","isGetAttribute":false}]}],"type":"OTHER","status":"ON","codeSnippet":"<script>\nvar q_mail = document.querySelectorAll('input[type=\"email\"]')[0];\nif(q_mail && q_mail.value){\n\tlet siteMember = q_mail.value;\n\tlet retUid = RET.cookieObj.getLocalCookie('__retuid');\n\tRET.sync.siteMember(retUid,retSiteId, {siteMember: siteMember})\n\tdocument.cookie = 'apd_account=; expires=Thu, 01 Jan 1970 00:00:00 GMT';\n\tdocument.cookie = 'apd_account=' + encodeURIComponent(siteMember) + \";max-age=31536000; path=/; domain=.amnet.tw\";\n}\nelse{\n\tconsole.log('mail empty!')\n}\n\n</script>","memo":"NOIFRAME","pushStatus":"ALL"},{"name":"ADS-Cookie-Sync","triggerList":[{"type":"PAGE_VIEW","urlPatternList":[{"key":"https://dentsu.surveycake.biz/","isGetAttribute":false},{"key":"surveycake.com","isGetAttribute":false}],"urlRegexList":[],"triggerDomList":[]}],"type":"OTHER","status":"ON","codeSnippet":"<img src=\"https://cm.g.doubleclick.net/pixel?google_nid=amnettw_dmp&google_cm&a=158&ckType=0\" style=\"display:none;\"/>","memo":"IFRAME","pushStatus":"ALL"},{"name":"UC-Cookie-Sync","triggerList":[{"type":"PAGE_VIEW","urlPatternList":[{"key":"https://dentsu.surveycake.biz/","isGetAttribute":false},{"key":"surveycake.com","isGetAttribute":false}],"urlRegexList":[],"triggerDomList":[]}],"type":"OTHER","status":"OFF","codeSnippet":"<script src=\"//ads.aralego.com/cookiesync\"></script>\n<script>\nvar now = new Date();\nvar target = new Image();\ntarget.src =\"https://sync.aralego.com/idsync?redirect=https%3A%2F%2Fa.amnet.tw%2Fcksync%2Fcommon%2F%3FckType%3D12%26otherId%3DUCFUID%26a%3D158%26t%3D\"+now.getTime();\n</script>","memo":"IFRAME","pushStatus":"ALL"},{"name":"TTD-Cookie-Sync","triggerList":[{"type":"PAGE_VIEW","urlPatternList":[{"key":"https://dentsu.surveycake.biz/","isGetAttribute":false},{"key":"surveycake.com","isGetAttribute":false}],"urlRegexList":[],"triggerDomList":[]}],"type":"OTHER","status":"ON","codeSnippet":"<img src=\"https://match.adsrvr.org/track/cmf/generic?ttd_pid=8jn97rr&ttd_puid=158&ttd_tpi=1\" style=\"display:none;\"/>","memo":"IFRAME","pushStatus":"ALL"},{"name":"GH-Cookie-Sync","triggerList":[{"type":"PAGE_VIEW","urlPatternList":[{"key":"surveycake.com","isGetAttribute":false}],"urlRegexList":[],"triggerDomList":[]}],"type":"OTHER","status":"ON","codeSnippet":"<img src=\"https://pioneer.ghtinc.com/cm?cn=dentsu&a=158&ckType=18\" width=\"1\"  height=\"1\" display=\"none\">","memo":"IFRAME","pushStatus":"ALL"},{"name":"TenMax-Cookie-Sync","triggerList":[{"type":"PAGE_VIEW","urlPatternList":[{"key":"surveycake.com","isGetAttribute":false}],"urlRegexList":[],"triggerDomList":[]}],"type":"OTHER","status":"ON","codeSnippet":"<img src=\"https://dmp.tenmax.io/ecm?id=dentsu&r=https%3A%2F%2Fa.amnet.tw%2Fcksync%2Fcommon%2F%3Fa%3D158%26ckType%3D19%26otherId%3D\" width=\"1\"  height=\"1\" display=\"none\">","memo":"IFRAME","pushStatus":"ALL"},{"name":"Hinet-Cookie-Sync","triggerList":[{"type":"PAGE_VIEW","urlPatternList":[{"key":"surveycake.com","isGetAttribute":false}],"urlRegexList":[],"triggerDomList":[]}],"type":"OTHER","status":"ON","codeSnippet":"<script>\nfunction getCookieValue(cookieName) {\n  const cookieArray = document.cookie.split(';');\n\n  for (let i = 0; i < cookieArray.length; i++) {\n    let cookie = cookieArray[i].trim();\n    if (cookie.indexOf(cookieName + '=') === 0) {\n      return cookie.substring(cookieName.length + 1, cookie.length);\n    }\n  }\n\n  return null;\n}\n</script>\n<script>\n    var partnerId = '5aaa20';\n    var partnerCookie = getCookieValue('__retuid');\n    var hiscript = document.createElement('script');\n    hiscript.type = 'text/javascript';\n    hiscript.async = true;\n    hiscript.src = '//t.ssp.hinet.net/utag.js';\n    document.body.append(hiscript);\n\n    window.__hitagCmdQueue = window.__hitagCmdQueue || [];\n    function hiball() {__hitagCmdQueue.push(arguments)};\n    hiball('cm', partnerId, partnerCookie);\n    hiball('fire', {'partnerId': partnerId, 'referrer': 'surveycake.com'});\n\n</script>","memo":"NOIFRAME","pushStatus":"ALL"}],"resTagPixelList":[],"ssidTrackList":[],"extParam":[],"tagTrackStatus":"ON","tagRecommendStatus":"OFF","depthScroll":"OFF","sdkSwitch":"ON","triggerRuleVos":[]}}