目的地広告では4つのイベントが使用されます。各イベントにパラメーターのセットがあります(パラメーターの一覧については、イベントパラメーターの詳細をご覧ください)。ウェブサイト上ではMetaピクセルを使い、AndroidアプリとiOSアプリではモバイルアプリイベントを使います。標準イベントとカスタムイベントの詳細をご確認ください。
このガイドは、Facebookピクセルが実装済みであることを前提としています。実装していない場合は、「Facebookピクセルと組み合わせたマーケティングAPIの使用」をご覧ください。
イベントを実行する際、ピクセルベースコードが読み込まれていることを確認してください。タグマネージャを使用する場合は、すべてのページのピクセルコードを持つタグを含んでいることを確認してください。このタグは、ピクセルイベントコードを持つタグの前に表示する必要があります。ピクセルの実装を検証するには、Facebookピクセルヘルパーを使用します。
// This sample assumes the Meta Pixel base code is already loaded fbq('track', 'Search', { // Fire the 'Search' event on the search results page // IF YOU CHOOSE NOT TO USE A RECOMMENDED PARAM, THEN REMOVE IT, DON'T LEAVE IT EMPTY // REQUIRED: city, don't use abbreviations city: 'New York', // REQUIRED: region, don't use abbreviations region: 'New York', // REQUIRED: country, don't use abbreviations country: 'United States', // RECOMMENDED: set to 'destination' content_type: 'destination', // RECOMMENDED: travel start date // Allows you to target people based on their travel dates (using a booking window) // Improves the landing experience with travel dates filled in (using template tags) // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD travel_start: '2018-04-01', // RECOMMENDED: travel end date // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD travel_end: '2018-04-05', // RECOMMENDED: content ids - include eg top 5 search results content_ids: '["123", "234", "345", "456", "567"]', // RECOMMENDED: number of adults num_adults: 1, // RECOMMENDED: number of children num_children: 0 });
// This sample assumes the Meta Pixel base code is already loaded fbq('track', 'ViewContent', { // Fire the 'ViewContent' event on the destination details page // IF YOU CHOOSE NOT TO USE A RECOMMENDED PARAM, THEN REMOVE IT, DON'T LEAVE IT EMPTY // REQUIRED: content id of destination that is shown content_ids: '123', // RECOMMENDED: set to : 'destination', // RECOMMENDED: travel start date // Allows you to target people based on their travel dates (using a booking window) // Improves the landing experience with travel dates filled in (using template tags) // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD travel_start: '2018-04-01', // RECOMMENDED: travel end date // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD travel_end: '2018-04-05', // RECOMMENDED: city, don't use abbreviations city: 'New York', // RECOMMENDED: region, don't use abbreviations region: 'New York', // RECOMMENDED: country, don't use abbreviations country: 'United States', // RECOMMENDED: number of adults num_adults: 1, // RECOMMENDED: number of children num_children: 0 });
// This sample assumes the Meta Pixel base code is already loaded fbq('track', 'InitiateCheckout', { // Fire the 'InitiateCheckout' event when the user enters the payment screen // IF YOU CHOOSE NOT TO USE A RECOMMENDED PARAM, THEN REMOVE IT, DON'T LEAVE IT EMPTY // REQUIRED: content id of destination that is being booked content_ids: '123', // REQUIRED: city, don't use abbreviations city: 'New York', // REQUIRED: region, don't use abbreviations region: 'New York', // REQUIRED: country, don't use abbreviations country: 'United States', // RECOMMENDED: set to 'destination' content_type: 'destination', // RECOMMENDED: travel start date // Allows you to target people based on their travel dates (using a booking window) // Improves the landing experience with travel dates filled in (using template tags) // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD travel_start: '2018-04-01', // RECOMMENDED: travel end date // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD travel_end: '2018-04-05', // RECOMMENDED: number of adults num_adults: 1, // RECOMMENDED: number of children num_children: 0 });
// This sample assumes the Meta Pixel base code is already loaded fbq('track', 'Purchase', { // Fire the 'Purchase' event on the booking or purchase confirmation page // IF YOU CHOOSE NOT TO USE A RECOMMENDED PARAM, THEN REMOVE IT, DON'T LEAVE IT EMPTY // REQUIRED: content id of destination that is being booked content_ids: '123', // REQUIRED: city, don't use abbreviations city: 'New York', // REQUIRED: region, don't use abbreviations region: 'New York', // REQUIRED: country, don't use abbreviations country: 'United States', // REQUIRED: total value of booking value: 1200, // REQUIRED: currency of booking currency: 'USD', // RECOMMENDED: set to 'destination' content_type: 'destination', // RECOMMENDED: travel start date // Allows you to target people based on their travel dates (using a booking window) // Improves the landing experience with travel dates filled in (using template tags) // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD travel_start: '2018-04-01', // RECOMMENDED: travel end date // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD travel_end: '2018-04-05', // RECOMMENDED: number of adults num_adults: 1, // RECOMMENDED: number of children num_children: 0 });
このガイドは、Facebook SDKがAndroidモバイルアプリに実装済みであることを前提としています。実装済みではない場合は、Android向けSDKをご覧ください。トラッキングパートナーをご利用の場合は、パートナーが必要なイベントをFacebookに必ず送るようにしてください。
Bundle parameters = new Bundle(); // IF YOU CHOOSE NOT TO USE A RECOMMENDED PARAM, THEN REMOVE IT, DON'T LEAVE IT EMPTY // REQUIRED: city, don't use abbreviations parameters.putString("fb_city", "New York"); // REQUIRED: region, don't use abbreviations parameters.putString("fb_region", "New York"); // REQUIRED: country parameters.putString("fb_country", "United States"); // RECOMMENDED: set to 'destination' parameters.putString(AppEventsConstants.EVENT_PARAM_CONTENT_TYPE, "destination"); // 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: travel start date // Allows you to target people based on their travel dates (using a booking window) // Improves the landing experience with travel dates filled in (using template tags) // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD parameters.putString("fb_travel_start", "2018-04-01"); // RECOMMENDED: travel end date // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD parameters.putString("fb_travel_end", "2018-04-05"); // RECOMMENDED: number of adults parameters.putInt("fb_num_adults", 1); // RECOMMENDED: number of children parameters.putInt("fb_num_children", 0); // 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 destination that is shown parameters.putString(AppEventsConstants.EVENT_PARAM_CONTENT_ID, "123"); // RECOMMENDED: set to 'destination' parameters.putString(AppEventsConstants.EVENT_PARAM_CONTENT_TYPE, "destination"); // RECOMMENDED: travel start date // Allows you to target people based on their travel dates (using a booking window) // Improves the landing experience with travel dates filled in (using template tags) // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD parameters.putString("fb_travel_start", "2018-04-01"); // RECOMMENDED: travel end date // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD parameters.putString("fb_travel_end", "2018-04-05"); // RECOMMENDED: city, don't use abbreviations parameters.putString("fb_city", "New York"); // RECOMMENDED: region, don't use abbreviations parameters.putString("fb_region", "New York"); // RECOMMENDED: country parameters.putString("fb_country", "United States"); // RECOMMENDED: number of adults parameters.putInt("fb_num_adults", 1); // RECOMMENDED: number of children parameters.putInt("fb_num_children", 0); // Fire the 'ViewContent' event on the destination details 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 destination that is being booked parameters.putString(AppEventsConstants.EVENT_PARAM_CONTENT_ID, "123"); // RECOMMENDED: set to 'destination' parameters.putString(AppEventsConstants.EVENT_PARAM_CONTENT_TYPE, "destination"); // REQUIRED: city, don't use abbreviations parameters.putString("fb_city", "New York"); // REQUIRED: region, don't use abbreviations parameters.putString("fb_region", "New York"); // REQUIRED: country parameters.putString("fb_country", "United States"); // RECOMMENDED: travel start date // Allows you to target people based on their travel dates (using a booking window) // Improves the landing experience with travel dates filled in (using template tags) // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD parameters.putString("fb_travel_start", "2018-04-01"); // RECOMMENDED: travel end date // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD parameters.putString("fb_travel_end", "2018-04-05"); // RECOMMENDED: number of adults parameters.putInt("fb_num_adults", 1); // RECOMMENDED: number of children parameters.putInt("fb_num_children", 0); // Fire the 'InitiateCheckout' event when the user enters the payment screen logger.logEvent( AppEventsConstants.EVENT_NAME_INITIATED_CHECKOUT, parameters );
// total value of booking BigDecimal purchaseAmount = BigDecimal.valueOf(1200); // REQUIRED: currency of booking Currency currency = Currency.getInstance("USD"); 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 destination that is being booked parameters.putString(AppEventsConstants.EVENT_PARAM_CONTENT_ID, "123"); // REQUIRED: city, don't use abbreviations parameters.putString("fb_city", "New York"); // REQUIRED: region, don't use abbreviations parameters.putString("fb_region", "New York"); // REQUIRED: country parameters.putString("fb_country", "United States"); // RECOMMENDED: set to 'destination' parameters.putString(AppEventsConstants.EVENT_PARAM_CONTENT_TYPE, "destination"); // RECOMMENDED: travel start date // Allows you to target people based on their travel dates (using a booking window) // Improves the landing experience with travel dates filled in (using template tags) // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD parameters.putString("fb_travel_start", "2018-04-01"); // RECOMMENDED: travel end date // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD parameters.putString("fb_travel_end", "2018-04-05"); // RECOMMENDED: number of adults parameters.putInt("fb_num_adults", 1); // RECOMMENDED: number of children parameters.putInt("fb_num_children", 0); // Use the built-in SDK method when the booking is confirmed logger.logPurchase( purchaseAmount, currency, parameters );
このガイドは、Facebook SDKがiOSモバイルアプリに実装済みであることを前提としています。実装済みではない場合は、iOS向けSDKをご覧ください。トラッキングパートナーをご利用の場合は、パートナーが必要なイベントをFacebookに必ず送るようにしてください。
// Fire the 'Search' event on the search results page [[FBSDKAppEvents shared] logEvent:FBSDKAppEventNameSearched // IF YOU CHOOSE NOT TO USE A RECOMMENDED PARAM, THEN REMOVE IT, DON'T LEAVE IT EMPTY parameters:@{ // REQUIRED: city, don't use abbreviations @"fb_city" : @"New York", // REQUIRED: region, don't use abbreviations @"fb_region" : @"New York", // REQUIRED: country, don't use abbreviations @"fb_country" : @"United States", // RECOMMENDED: If sent, it must be set to 'destination' FBSDKAppEventParameterNameContentType : @"destination", // RECOMMENDED: content ids - include eg top 5 search results FBSDKAppEventParameterNameContentID : @"[\"123\", \"234\", \"345\", \"456\", \"567\"]", // RECOMMENDED: travel start date // Allows you to target people based on their travel dates (using a booking window) // Improves the landing experience with travel dates filled in (using template tags) // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD @"fb_travel_start" : @"2018-04-01", // RECOMMENDED: travel end date // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD @"fb_travel_end" : @"2018-04-15", // RECOMMENDED: number of adults @"fb_num_adults" : @1, // RECOMMENDED: number of children @"fb_num_children" : @0 } ];
// Fire the 'ViewContent' event on the destination details page [[FBSDKAppEvents shared] logEvent:FBSDKAppEventNameViewedContent // IF YOU CHOOSE NOT TO USE A RECOMMENDED PARAM, THEN REMOVE IT, DON'T LEAVE IT EMPTY parameters:@{ // REQUIRED: content id of destination that is shown FBSDKAppEventParameterNameContentID : @"123", // RECOMMENDED: If sent, it must be set to 'destination' FBSDKAppEventParameterNameContentType : @"destination", // RECOMMENDED: travel start date // Allows you to target people based on their travel dates (using a booking window) // Improves the landing experience with travel dates filled in (using template tags) // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD @"fb_travel_start_date" : @"2018-04-01", // RECOMMENDED: travel end date // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD @"fb_travel_end_date" : @"2018-04-15", // RECOMMENDED: city, don't use abbreviations @"fb_city" : @"New York", // RECOMMENDED: region, don't use abbreviations @"fb_region" : @"New York", // RECOMMENDED: country, don't use abbreviations @"fb_country" : @"United States", // RECOMMENDED: number of adults @"fb_num_adults" : @1, // RECOMMENDED: number of children @"fb_num_children" : @0 } ];
// Fire the 'InitiateCheckout' event when the user enters the payment screen [[FBSDKAppEvents shared] logEvent:FBSDKAppEventNameInitiatedCheckout // IF YOU CHOOSE NOT TO USE A RECOMMENDED PARAM, THEN REMOVE IT, DON'T LEAVE IT EMPTY parameters:@{ // REQUIRED: content id of destination that is being booked FBSDKAppEventParameterNameContentID : @"123", // RECOMMENDED: If sent, it must be set to 'destination' FBSDKAppEventParameterNameContentType : @"destination", // REQUIRED: city, don't use abbreviations @"fb_city" : @"New York", // REQUIRED: region, don't use abbreviations @"fb_region" : @"New York", // REQUIRED: country, don't use abbreviations @"fb_country" : @"United States", // RECOMMENDED: travel start date // Allows you to target people based on their travel dates (using a booking window) // Improves the landing experience with travel dates filled in (using template tags) // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD @"fb_travel_start" : @"2018-04-01", // RECOMMENDED: travel end date // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD @"fb_travel_end" : @"2018-04-15", // RECOMMENDED: number of adults @"fb_num_adults" : @1, // RECOMMENDED: number of children @"fb_num_children" : @0 } ];
// Fire the 'Purchase' event when the booking is confirmed [[FBSDKAppEvents shared] logPurchase:1200 // currency of booking currency:@"USD" // IF YOU CHOOSE NOT TO USE A RECOMMENDED PARAM, THEN REMOVE IT, DON'T LEAVE IT EMPTY parameters:@{ // REQUIRED: content id of destination that is being booked FBSDKAppEventParameterNameContentID : @"123", // RECOMMENDED: If sent, it must be set to 'destination' FBSDKAppEventParameterNameContentType : @"destination", // REQUIRED: city, don't use abbreviations @"fb_city" : @"New York", // REQUIRED: region, don't use abbreviations @"fb_region" : @"New York", // REQUIRED: country, don't use abbreviations @"fb_country" : @"United States", // RECOMMENDED: travel start date // Allows you to target people based on their travel dates (using a booking window) // Improves the landing experience with travel dates filled in (using template tags) // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD @"fb_travel_start" : @"2018-04-01", // RECOMMENDED: travel end date // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD @"fb_travel_end" : @"2018-04-15", // RECOMMENDED: number of adults @"fb_num_adults" : @1, // RECOMMENDED: number of children @"fb_num_children" : @0 } ];
モバイルでは、パラメーターの名前がMetaピクセルと異なります。多くの場合、先頭にfb_
が付きます(例: content_ids
に対してfb_content_id
)。ただし、いくつかの例外があります(例: value
に対して_valueToSum
)。
content_ids
やcontent_type
などで複数の値を渡す場合は、JSONエンコードされた値の配列'["value1", "value2"]'
を指定します。値をコンマで連結しないでください。
パラメーターの名前と型 | 説明 |
---|---|
型: 文字列 | 推奨。 利用者の旅行開始日。 例:
|
型: 文字列 | 推奨。 利用者の旅行終了日。 |
型: 文字列または文字列[] |
旅行カタログに掲載されている関連ID。例えば、 例:
|
型: 文字列または文字列[] | 推奨。 送信する場合は、 |
型: 文字列 |
利用者の意図した場所の都市を提供します。 例: |
型: 文字列 |
利用者のインテントから取得した場所の地域を指定します。 例: |
型: 文字列 |
利用者の意図した場所の国を提供します。 例: |
型: 文字列 | 大人の旅行者の数。指定した場合、テンプレートタグを使用する広告でこの情報を使用できます。 例: |
型: 整数 | 子どもの旅行者の数。指定した場合、テンプレートタグを使用する広告でこの情報を使用できます。 例: |
型: 文字列または文字列[] | その利用者に提案する目的地を表すIDのリスト。このパラメーターは 例: |
型: 浮動小数点型 | Purchaseでは必須。予約の合計金額(広告主にとってそのイベントの価値を表す数値)です。 例: |
型: 文字列 | Purchaseでは必須。金額の通貨です。ISO 4217通貨形式で指定します。 例: |