成交目標可讓您追蹤顧客在您網站上的動作,像是下單購買和註冊獎勵方案等等。每個動作為您的業務帶來的價值均可能不同。正因如此,我們才會讓您為每個成交目標各設定一個適當的收入值,以便追蹤您的投資報酬率 (ROI)。這就是所謂的報告變動收入。連結網址與事件成交目標均可以報告變動收入。
開始設定變動收入前,請先確認您具有:
從頂端功能表中,選取 [工具] > [成交目標] 。
如果您使用 新的 Microsoft Advertising 導覽,請從左側的導覽功能表,將滑鼠指標停留在 [成交] 上,然後選取 [成交目標]。
若要查看成交目標可用貨幣的完整清單,請參閱 轉換目標收入貨幣。
接下來要編輯 UET 追蹤程式碼來支援變動收入。如果您已新增 UET 標籤追蹤程式碼至網站,可以修改網站程式碼中的標籤。如果您尚未新增標籤至網站,請參閱 如何將 UET 標籤新增至我的網站?,但請務必記得將標籤新增至成交目標確認網頁的本文區段。
讓我們看看在 PHP 網頁中,如何針對連結網址類型目標來傳遞變動收入。下列的範例會從 JavaScript 函式讀取動態的變動收入值。要傳送靜態值或是從 JavaScript 變數或 HTML 元素讀取靜態值,也是非常容易。
您必須以大寫字母傳遞貨幣值。例如, 'currency': 'USD',而不是 'currency': 'usd'。
<head>Your page title
</head>
<body>// Let's say this is where you pasted the UET tag.
<script>Your UET tag is here.</script>// Here is where to paste the following JavaScript:
<script>
window.uetq = window.uetq || [];
window.uetq.push('event', '', {'revenue_value': Replace_with_Variable_Revenue_Function(), 'currency': 'REPLACE_WITH_CURRENCY_CODE'});
</script>
...
</body>
雖然這並非自訂事件成交目標 (請參閱下節),您還是必須加上命令 'event'。對於連結網址目標,請直接讓事件動作的部分空著 (如 'event', '')。
<head>Your page title
</head>
<body>// Let's say this is where you pasted the UET tag.
<script>Your UET tag is here.</script>// Here is where to paste the following JavaScript:
<script>
window.uetq = window.uetq || [];
window.uetq.push('event', 'Event action', {'event_category': 'Replace_with_Event_Category', 'event_label': 'Replace_with_Event_Label', 'event_value': 'Replace_with_Event_Value', 'revenue_value': Replace_with_Variable_Revenue_Function(), 'currency': 'REPLACE_WITH_CURRENCY_CODE'});
</script>
...
</body>
如需更新自訂事件參數的指示,請參閱 如何使用 UET 追蹤自訂事件。
如果您已於自己網站的程式碼中為自訂事件新增 JavaScript,那麼在這個步驟中,您只需要插入變動收入參數:
'revenue_value': Replace_with_Variable_Revenue_Function(), 'currency': 'REPLACE_WITH_CURRENCY_CODE'
<head>Your page title
</head>
<body>
<script>Your UET tag is here.</script>
<script>
window.uetq = window.uetq || [];
window.uetq.push('event', '', {'revenue_value': Replace_with_Variable_Revenue_Function(), 'currency': 'REPLACE_WITH_CURRENCY_CODE'});
</script>
...// Here is an example function, named "GetRevenueValue()", that defines variable revenue:
<script> function GetRevenueValue() { return 6; } </script>
...
</body>
當您的收入函式傳遞值時,它必須使用小數點 (如 12.34),而不是逗號 (如12,34)。
<head>Your page title
</head>
<body>
<script>Your UET tag is here.</script>
<script>
window.uetq = window.uetq || [];
window.uetq.push('event', '', {'revenue_value': GetRevenueValue(), 'currency': 'REPLACE_WITH_CURRENCY_CODE'});
</script>
...
<script> function GetRevenueValue() { return 6; } </script>
...
</body>
您必須以大寫字母傳遞貨幣值。例如, 'currency': 'USD',而不是 'currency': 'usd'。
<head>Your page title
</head>
<body>
<script>Your UET tag is here.</script>
<script>
window.uetq = window.uetq || [];
window.uetq.push('event', '', {'revenue_value': GetRevenueValue(), 'currency': 'GBP'});
</script>
...
<script> function GetRevenueValue() { return 6; } </script>
...
</body>
若要查看貨幣代碼的完整清單,請參閱 轉換目標收入貨幣。如果成交目標中未設定任何貨幣,您可以移除 'currency' 參數。