汽车广告使用的事件包含一组参数(事件参数详情的完整清单)。您可以在自己的网站上使用 Facebook Pixel 像素代码,在自己的 Android 应用和 iOS 应用中使用移动应用事件。
事件 | 触发时间 | 代码示例 |
---|---|---|
Search | 在汽车或库存搜索的搜索结果页面上 | Pixel 像素代码 | Android | iOS |
ViewContent | 在要追踪关键内容浏览量的网页上。例如:汽车详情页面、型号页面、汽车优惠或奖励页面。 | Pixel 像素代码 | Android | iOS |
AddToWishlist | 当用户保存或收藏特定车辆交易帖,或对特定车辆交易帖表现出兴趣时 | Pixel 像素代码 | Android | iOS |
此指南假设您已安装 Facebook Pixel 像素代码。如果尚未安装,请参阅将市场营销 API 与 Pixel 像素代码结合使用。
准备工作
// This sample assumes the FB Pixel base code is already loaded fbq('track', 'Search', { content_type: 'vehicle', // RECOMMENDED: If sent, it must be set to 'vehicle' content_ids: ['123'], // RECOMMENDED: array of vehicle IDs postal_code: '94025', // RECOMMENDED country: 'United States', // RECOMMENDED don't use abbreviations make: 'Lexus', // RECOMMENDED model: 'ES', // RECOMMENDED year: '2017', // RECOMMENDED state_of_vehicle: 'CPO', // RECOMMENDED exterior_color: 'black', // RECOMMENDED transmission: 'automatic', // RECOMMENDED body_style: 'sedan', // RECOMMENDED fuel_type: 'gasoline', // RECOMMENDED drivetrain: 'awd', // RECOMMDENDED price: 1234.99, // RECOMMENDED, up to 2 decimals optional currency: 'USD', // REQUIRED if price and preferred_price_range is used, currency has to be the same for both price and preferred_price_range preferred_price_range: '[10000,20000]' // Optional up to two decimals, min,max });
// This sample assumes the FB Pixel base code is already loaded fbq('track', 'ViewContent', { content_type: 'vehicle', // RECOMMENDED: If sent, it must be set to 'vehicle' content_ids: ['123'], // REQUIRED: array of vehicle IDs postal_code: '94025', // RECOMMENDED country: 'United States', // RECOMMENDED don't use abbreviations make: 'Lexus', // RECOMMENDED model: 'ES', // RECOMMENDED year: '2017', // RECOMMENDED state_of_vehicle: 'CPO', // RECOMMENDED exterior_color: 'black', // RECOMMENDED transmission: 'automatic', // RECOMMENDED body_style: 'sedan', // RECOMMENDED fuel_type: 'gasoline', // RECOMMENDED drivetrain: 'awd', // RECOMMDENDED price: 1234.99, // RECOMMENDED, up to 2 decimals optional currency: 'USD', // REQUIRED if price and preferred_price_range is used preferred_price_range: '[10000,20000]' // Optional up to two decimals, min,max });
// This sample assumes the FB Pixel base code is already loaded fbq('track', 'AddToWishlist', { content_type: 'vehicle', // RECOMMENDED: If sent, it must be set to 'vehicle' content_ids: ['123'], // REQUIRED: array of vehicle IDs postal_code: '94025', // RECOMMENDED country: 'United States', // RECOMMENDED don't use abbreviations make: 'Lexus', // RECOMMENDED model: 'ES', // RECOMMENDED year: '2017', // RECOMMENDED state_of_vehicle: 'CPO', // RECOMMENDED exterior_color: 'black', // RECOMMENDED transmission: 'automatic', // RECOMMENDED body_style: 'sedan', // RECOMMENDED fuel_type: 'gasoline', // RECOMMENDED drivetrain: 'awd', // RECOMMDENDED price: 1234.99, // RECOMMENDED, up to 2 decimals optional currency: 'USD', // REQUIRED if price and preferred_price_range is used preferred_price_range: '[10000,20000]' // Optional up to two decimals, min,max });
此指南假设您已经在 Android 移动应用中实现了 Facebook SDK。如果尚未实现,请参阅 Android SDK。如果您与成效衡量合作伙伴合作,请确保他们会将必要事件传给 Facebook。
Bundle parameters = new Bundle(); // IF YOU CHOOSE NOT TO USE A RECOMMENDED PARAM, THEN REMOVE IT, DON'T LEAVE IT EMPTY // RECOMMENDED: If sent, it must be set to 'vehicle' parameters.putString(AppEventsConstants.EVENT_PARAM_CONTENT_TYPE, "vehicle"); // RECOMMENDED: content ids - include eg top 5 search results parameters.putString(AppEventsConstants.EVENT_PARAM_CONTENT_ID, "[\"123\", \"234\", \"345\", \"456\", \"567\"]"); // top search results // RECOMMENDED: postal_code parameters.putString("fb_postal_code", "94025"); // RECOMMENDED: country parameters.putString("fb_country", "United States"); // RECOMMENDED: make // Allows you to target people based on their search of a specific make parameters.putString("fb_make", "Lexus"); // RECOMMENDED: model // Allows you to target people based on their search of a specific make model parameters.putString("fb_model", "ES"); // RECOMMENDED: year, in yyyy format // Allows you to target people based on their search for vehicles manufactured from a specific year parameters.putInt("fb_year", "2017"); // RECOMMENDED: state_of_vehicle // Allows you to target people based on their search of specific type of vehicle parameters.putString("fb_state_of_vehicle", "CPO"); // RECOMMENDED: exterior_color parameters.putString("fb_exterior_color", "black"); // RECOMMENDED: transmission parameters.putString("fb_transmission", "automatic"); // RECOMMENDED: body_style // Allows you to target people based on their search of a vehicle body style parameters.putString("fb_body_style", "sedan"); // RECOMMENDED: fuel_type parameters.putString("fb_fuel_type", "gasoline"); // RECOMMENDED: drivetrain parameters.putString("fb_drivetrain", "awd"); // RECOMMENDED: price parameters.putInt("fb_price", 1234.99); // RECOMMENDED: currency parameters.putInt("fb_currency", 'USD'); // RECOMMENDED: preferred_price_range parameters.putInt("fb_preferred_price_range", '[10000,20000]'); // Fire the 'Search' event on the search results page logger.logEvent(AppEventsConstants.EVENT_NAME_SEARCHED, parameters );
Bundle parameters = new Bundle(); // IF YOU CHOOSE NOT TO USE A RECOMMENDED PARAM, THEN REMOVE IT, DON'T LEAVE IT EMPTY // REQUIRED: content id of the vehicle that is shown parameters.putString(AppEventsConstants.EVENT_PARAM_CONTENT_ID, "123"); // RECOMMENDED: If sent, it must be set to 'vehicle' parameters.putString(AppEventsConstants.EVENT_PARAM_CONTENT_TYPE, "vehicle"); // RECOMMENDED: postal_code parameters.putString("fb_postal_code", "94025"); // RECOMMENDED: country parameters.putString("fb_country", "United States"); // RECOMMENDED: make // Allows you to target people based on their search of a specific make parameters.putString("fb_make", "Lexus"); // RECOMMENDED: model // Allows you to target people based on their search of a specific make model parameters.putString("fb_model", "ES"); // RECOMMENDED: year, in yyyy format // Allows you to target people based on their search for vehicles manufactured from a specific year parameters.putInt("fb_year", "2017"); // RECOMMENDED: state_of_vehicle // Allows you to target people based on their search of specific type of vehicle parameters.putString("fb_state_of_vehicle", "CPO"); // RECOMMENDED: exterior_color parameters.putString("fb_exterior_color", "black"); // RECOMMENDED: transmission parameters.putString("fb_transmission", "automatic"); // RECOMMENDED: body_style // Allows you to target people based on their search of a vehicle body style parameters.putString("fb_body_style", "sedan"); // RECOMMENDED: fuel_type parameters.putString("fb_fuel_type", "gasoline"); // RECOMMENDED: drivetrain parameters.putString("fb_drivetrain", "awd"); // RECOMMENDED: price parameters.putInt("fb_price", 1234.99); // RECOMMENDED: currency parameters.putInt("fb_currency", 'USD'); // RECOMMENDED: preferred_price_range parameters.putInt("fb_preferred_price_range", '[10000,20000]'); // Fire the 'ViewContent' event on the vehicle details or other specific content page logger.logEvent(AppEventsConstants.EVENT_NAME_VIEWED_CONTENT, parameters );
Bundle parameters = new Bundle(); // IF YOU CHOOSE NOT TO USE A RECOMMENDED PARAM, THEN REMOVE IT, DON'T LEAVE IT EMPTY // REQUIRED: content id of the vehicle that is added to wishlist parameters.putString(AppEventsConstants.EVENT_PARAM_CONTENT_ID, "123"); // RECOMMENDED: If sent, it must be set to 'vehicle' parameters.putString(AppEventsConstants.EVENT_PARAM_CONTENT_TYPE, "vehicle"); // RECOMMENDED: postal_code parameters.putString("fb_postal_code", "94025"); // RECOMMENDED: country parameters.putString("fb_country", "United States"); // RECOMMENDED: make // Allows you to target people based on their search of a specific make parameters.putString("fb_make", "Lexus"); // RECOMMENDED: model // Allows you to target people based on their search of a specific make model parameters.putString("fb_model", "ES"); // RECOMMENDED: year, in yyyy format // Allows you to target people based on their search for vehicles manufactured from a specific year parameters.putInt("fb_year", "2017"); // RECOMMENDED: state_of_vehicle // Allows you to target people based on their search of specific type of vehicle parameters.putString("fb_state_of_vehicle", "CPO"); // RECOMMENDED: exterior_color parameters.putString("fb_exterior_color", "black"); // RECOMMENDED: transmission parameters.putString("fb_transmission", "automatic"); // RECOMMENDED: body_style // Allows you to target people based on their search of a vehicle body style parameters.putString("fb_body_style", "sedan"); // RECOMMENDED: fuel_type parameters.putString("fb_fuel_type", "gasoline"); // RECOMMENDED: drivetrain parameters.putString("fb_drivetrain", "awd"); // RECOMMENDED: price parameters.putInt("fb_price", 1234.99); // RECOMMENDED: currency parameters.putInt("fb_currency", 'USD'); // RECOMMENDED: preferred_price_range parameters.putInt("fb_preferred_price_range", '[10000,20000]'); // Fire the 'AddToWishlist' event on the vehicle details or other specific content page logger.logEvent(AppEventsConstants.EVENT_NAME_ADDED_TO_WISHLIST, parameters );
此指南假设您已经在 iOS 移动应用中实现了 Facebook SDK。如果尚未实现,请参阅 iOS SDK。如果您与成效衡量合作伙伴合作,请确保他们会将必要事件传给 Facebook。
// Fire the 'Search' event on the search results page [FBSDKAppEvents logEvent:FBSDKAppEventNameSearched // IF YOU CHOOSE NOT TO USE A RECOMMENDED PARAM, THEN REMOVE IT, DON'T LEAVE IT EMPTY parameters:@{ // RECOMMENDED: If sent, it must be set to 'vehicle' FBSDKAppEventParameterNameContentType : @"vehicle", // RECOMMENDED: content ids - include eg top 5 search results FBSDKAppEventParameterNameContentID : @"[\"123\", \"234\", \"345\", \"456\", \"567\"]", // RECOMMENDED: postal_code @"fb_postal_code" : @"94110", // RECOMMENDED: country @"fb_country" : @"US", // RECOMMENDED: make // Allows you to target people based on their search of a specific make @"fb_make" : @"Toyota", // RECOMMENDED: model // Allows you to target people based on their search of a specific make model @"fb_model" : @"Camry", // RECOMMENDED: year, in yyyy format @"fb_year" : @"2015", // RECOMMENDED: state_of_vehicle // Allows you to target people based on their search of specific type of vehicle @"fb_state_of_vehicle" : @"CPO", // RECOMMENDED: exterior_color @"fb_exterior_color" : @"black", // RECOMMENDED: transmission @"fb_transmission" : @"automatic", // RECOMMENDED: body_style // Allows you to target people based on their search of a vehicle body style @"fb_body_style" : @"Sedan", // RECOMMENDED: fuel_type @"fb_fuel_type" : @"gasoline", // RECOMMENDED: drivetrain @"fb_drivetrain" : @"awd", // RECOMMENDED: price @"fb_price" : @18000, // RECOMMENDED: currency @"fb_currency" : @"USD", // RECOMMENDED: preferred_price_range @"fb_preferred_price_range" : @"[10000,20000]", } ];
// Fire the 'ViewContent' event on the search results page [FBSDKAppEvents logEvent:FBSDKAppEventNameViewedContent // IF YOU CHOOSE NOT TO USE A RECOMMENDED PARAM, THEN REMOVE IT, DON'T LEAVE IT EMPTY parameters:@{ // REQUIRED: content ids for vehicle shown FBSDKAppEventParameterNameContentID : @"123", // RECOMMENDED: If sent, it must be set to 'vehicle' FBSDKAppEventParameterNameContentType : @"vehicle", // RECOMMENDED: postal_code @"fb_postal_code" : @"94110", // RECOMMENDED: country @"fb_country" : @"US", // RECOMMENDED: make // Allows you to target people based on their search of a specific make @"fb_make" : @"Toyota", // RECOMMENDED: model // Allows you to target people based on their search of a specific make model @"fb_model" : @"Camry", // RECOMMENDED: year, in yyyy format @"fb_year" : @"2015", // RECOMMENDED: body_style // Allows you to target people based on their search of a vehicle body style @"fb_body_style" : @"Sedan", // RECOMMENDED: state_of_vehicle // Allows you to target people based on their search of specific type of vehicle @"fb_state_of_vehicle" : @"CPO", // RECOMMENDED: exterior_color @"fb_exterior_color" : @"black", // RECOMMENDED: transmission @"fb_transmission" : @"automatic", // RECOMMENDED: fuel_type @"fb_fuel_type" : @"gasoline", // RECOMMENDED: drivetrain @"fb_drivetrain" : @"FWD", // RECOMMENDED: price @"fb_price" : 18000, } ];
// Fire the 'AddToWishlist' event on the search results page [FBSDKAppEvents logEvent:FBSDKAppEventNameAddedToWishlist // IF YOU CHOOSE NOT TO USE A RECOMMENDED PARAM, THEN REMOVE IT, DON'T LEAVE IT EMPTY parameters:@{ // REQUIRED: content id of vehicle added to wishlist FBSDKAppEventParameterNameContentID : @"123", // RECOMMENDED: If sent, it must be set to 'vehicle' FBSDKAppEventParameterNameContentType : @"vehicle", // RECOMMENDED: postal_code @"fb_postal_code" : @"94110", // RECOMMENDED: country @"fb_country" : @"US", // RECOMMENDED: make // Allows you to target people based on their search of a specific make @"fb_make" : @"Toyota", // RECOMMENDED: model // Allows you to target people based on their search of a specific make model @"fb_model" : @"Camry", // RECOMMENDED: year, in yyyy format @"fb_year" : @"2015", // RECOMMENDED: body_style // Allows you to target people based on their search of a vehicle body style @"fb_body_style" : @"Sedan", // RECOMMENDED: state_of_vehicle // Allows you to target people based on their search of specific type of vehicle @"fb_state_of_vehicle" : @"CPO", // RECOMMENDED: exterior_color @"fb_exterior_color" : @"black", // RECOMMENDED: transmission @"fb_transmission" : @"automatic", // RECOMMENDED: fuel_type @"fb_fuel_type" : @"gasoline", // RECOMMENDED: drivetrain @"fb_drivetrain" : @"FWD", // RECOMMENDED: price @"fb_price" : 18000, } ];
虽然每位汽车广告主可能对网站具有略微不同的目标或自定义追踪需求,我们还是在下表中根据与汽车网站相关的最常见操作和 KPI,提供了一些建议的参数。
参数是一个标准事件的子集,可追踪每个操作的更多信息。例如,如果您正在追踪汽车详情页面 (VDP) 上的 ViewContent
事件,通过使用参数,您还可以在用户每次查看该页面时获取相关汽车的品牌、型号和年份等信息。
虽然对于一般 Pixel 像素代码设置,参数是可选项,但是就汽车广告而言,其中一些特定参数是必要项。建议至少添加必要参数,以便现在或将来更轻松地设置 DAA。
fb_
开头,但有一些例外,例如 content_ids
与 fb_content_id
,value
与 _valueToSum
。content_ids
或 content_type
中提供多个值)时,请提供由这些值组成的一个 JSON 编码数组:["value1", "value2"]
。注意:请勿用逗号来连接值。字段和类型 | 描述 |
---|---|
类型:字符串 | 对于 预定义事件名称,您可通过这些名称衡量广告系列的表现以及捕获受众的意向。 |
类型:由字符串组成的数组 | 对于 汽车目录中列出的相关编号。 示例: |
类型:字符串 | 建议 商品或内容的类型。支持的值: |
类型:字符串 | 建议添加。 汽车所在位置的邮政编码。 示例: |
类型:字符串 | 建议添加。 汽车所在位置的国家/地区名称。 示例: |
类型:字符串 | 建议添加。 汽车的品牌/制造商。 示例: |
类型:字符串 | 建议添加。 汽车型号。 示例: |
类型:整数 | 建议添加。 汽车上市年份,格式为 yyyy。 示例: |
类型:枚举 | 建议添加。 表示汽车是新车还是二手车的关键参数。支持的值: |
类型:整数 | 建议添加。 汽车里程(以公里或英里为单位);新车的值为零 ( 示例: |
类型:字符串 | 建议添加。 里程单位:英里 ( |
类型:字符串 | 建议添加。 汽车的外观颜色。 示例: |
类型:枚举 | 建议添加。 汽车的变速器类型。支持的值: |
类型:枚举 | 建议添加。 车身样式。支持的值: |
类型:枚举 | 建议添加。 汽车的燃料类型。支持的值: |
类型:枚举 | 建议添加。 汽车的传动系统。支持的值: |
类型:浮点数 | 建议添加。 汽车价格。 示例: |
类型:[浮点数(最小值), 浮点数(最大值)] | 建议添加。 汽车价格范围。 示例: |
类型:字符串 | 建议添加。
|
类型:字符串 | 建议添加。 汽车配置。 示例: |
类型:字符串 | 建议添加。 汽车识别码。不超过 17 个字符。 示例: |
类型:字符串 | 可选。 汽车内饰颜色。 示例: |
类型:枚举 | 可选。 汽车的物理状况。支持的值: |
类型:字符串 | 对于 使用 示例: |
类型:字符串 | 对于 使用 示例: |
类型:字符串 | 对于 使用 示例: |