自訂轉換變數
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
自訂轉換變數可讓您將額外資訊 (以代碼形式) 與透過 Google Ads API 匯入的轉換建立關聯,例如點擊或通話轉換。有了這項資訊,您就能建立區隔報表,取得更豐富的轉換資料。
舉例來說,當您匯入新藍色帽子的購買轉換時,也可以匯入兩個相關聯的標記:color
和 status
,值分別為 blue
和 new
。步驟如下:
您可以視需要建立任意數量的自訂轉換變數。每個變數會對應一個代碼。因此,如要使用兩個標記 (color
和 status
),就必須建立兩個自訂變數。ConversionCustomVariable
的必填欄位如下:
name
:用於識別變數。名稱不得重複。
tag
:以我們的範例來說,標記是 color
和 status
。網站將轉換資料傳送至 Google Ads 時,系統會使用事件程式碼片段中的代碼。如果您使用 Google Ads API,匯入轉換時需要指定自訂變數的資源名稱,詳情請見下一個步驟。
匯入轉換 (例如 ClickConversion
) 時,請將 custom_variables
設為您在上一步建立的所有自訂變數清單。您必須設定每個自訂變數的所有欄位:
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-26 (世界標準時間)。
[null,null,["上次更新時間:2025-08-26 (世界標準時間)。"],[[["\u003cp\u003eCustom conversion variables allow associating additional information, like tags, to conversions uploaded via the Google Ads API.\u003c/p\u003e\n"],["\u003cp\u003eTo use custom variables, first create them, defining a unique name and tag for each desired piece of information.\u003c/p\u003e\n"],["\u003cp\u003eWhen uploading a conversion, include the custom variables, specifying their resource name and the corresponding value for the tag.\u003c/p\u003e\n"],["\u003cp\u003eThis process lets you add details like 'color' or 'status' to conversions, enabling richer data analysis and reporting.\u003c/p\u003e\n"]]],[],null,["# Custom Conversion Variables\n\n[Custom conversion variables](//support.google.com/google-ads/answer/9964350)\nlet you associate additional information, in the form of tags, to a conversion\nthat you import using the Google Ads API, such as click or call conversions. With this\ninformation, you can create segmented reports that provide richer data about\nyour conversions.\n\nFor example, when importing a conversion for the purchase of a new blue hat,\nyou could also import two associated tags: `color` and `status` with the values\n`blue` and `new`, respectively. Here are the steps:\n\n1. Create as many custom conversion variables as you need. Each variable\n corresponds to one tag. Therefore, if you want two tags (`color` and\n `status`), you need to create two custom variables. The required fields for\n [`ConversionCustomVariable`](/google-ads/api/reference/rpc/v21/ConversionCustomVariable) are as\n follows:\n\n | **Note:** See [`ConversionCustomVariable`](/google-ads/api/reference/rpc/v21/ConversionCustomVariable) for limitations on its fields.\n - [`name`](/google-ads/api/reference/rpc/v21/ConversionCustomVariable#name): Identifies the variable. The name must be unique.\n - [`tag`](/google-ads/api/reference/rpc/v21/ConversionCustomVariable#tag): For our example, the tags are `color` and `status`. Tags are used in the [event\n snippet](//support.google.com/google-ads/answer/9962082#Add&zippy=%2Cconversion-tracking-using-tags-on-your-website) when a conversion is sent to Google Ads by your website. If you use the Google Ads API, you would need to specify the resource name of the custom variables when importing conversions, as detailed in the next step.\n2. When importing a conversion, such as\n [`ClickConversion`](/google-ads/api/reference/rpc/v21/ClickConversion), set\n [`custom_variables`](/google-ads/api/reference/rpc/v21/ClickConversion#custom_variables%5B%5D) to\n the list of all custom variables you created in the previous step. You need\n to set all the fields of each custom variable:\n\n - [`conversion_custom_variable`](/google-ads/api/reference/rpc/v21/CustomVariable#conversion_custom_variable): The resource name of the custom variable you created in the previous step.\n - [`value`](/google-ads/api/reference/rpc/v21/CustomVariable#conversion_custom_variable): The value for the tag you want to associate with the conversion. For our example: `blue` and `new`."]]