Google 代碼 (gtag.js) 參數參考資料
下表說明可以使用 config
指令、使用 set
指令設定,或透過 event
指令傳遞的參數。
如要進一步瞭解產品特定參數,請參閱對應說明文件:
控制參數
參數 |
值類型 |
範例值 |
說明 |
groups |
字串或字串陣列 |
「default,vendors」 |
config 指令會使用這個欄位,將目標指派給一或多個群組。 |
send_to |
字串或字串陣列 |
「G-XXXXXX」 |
設定要接收事件資料的目標帳戶/資源。 |
event_callback |
功能 |
function() { form.submit(); } |
處理 event 指令完成時會呼叫的 JavaScript 回呼函式。 |
event_timeout |
整數 |
2000 |
event_callback 使用的逾時時間 (以毫秒為單位)。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-02-06 (世界標準時間)。
[null,null,["上次更新時間:2024-02-06 (世界標準時間)。"],[[["The `config`, `set`, and `event` commands allow you to configure parameters for controlling data collection and processing."],["Parameters include specifying target groups (`groups`), destination for event data (`send_to`), callback functions (`event_callback`), and timeout for callbacks (`event_timeout`)."],["Detailed information on product-specific parameters can be found in the linked documentation for Google Ads, Campaign Manager, Search Ads 360, and Google Analytics."]]],["The `config`, `set`, and `event` commands use configurable parameters. `groups` assigns a target to one or more groups. `send_to` specifies the target account or property. `event_callback` triggers a JavaScript function upon completion of an `event` command. `event_timeout` sets the timeout for the `event_callback` in milliseconds. Product-specific parameters can be found in the documentation for Google Ads conversions, Google Ads remarketing, Campaign Manager and Search Ads 360, and Google Analytics.\n"]]