ホテル広告では4つのイベントを使用します。すべてのイベントにはそれぞれのパラメーターがあります(一覧についてはイベントパラメーターの詳細を参照)。ウェブサイトの場合はFacebookピクセルを使用し、AndroidアプリとiOSアプリの場合はモバイルアプリイベントを使用します。
このガイドは、Facebookピクセルが実装済みであることを前提としています。実装していない場合は、「Facebookピクセルと組み合わせたマーケティングAPIの使用」をご覧ください。
イベントを実行する際、ピクセルベースコードが読み込まれていることを確認してください。タグマネージャを使用する場合は、すべてのページのピクセルコードを持つタグを含んでいることを確認してください。このタグは、ピクセルイベントコードを持つタグの前に表示する必要があります。ピクセルの実装を検証するには、Facebookピクセルヘルパーを使用します。
// This sample assumes the FB 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 // RECOMMENDED: set to 'hotel' content_type: 'hotel', // HIGHLY RECOMMENDED: checkin 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 checkin_date: '2018-04-01', // HIGHLY RECOMMENDED: checkout date // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD checkout_date: '2018-04-05', // RECOMMENDED: content ids - include eg top 5 search results content_ids: '["123", "234", "345", "456", "567"]', // 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: number of adults num_adults: 1, // RECOMMENDED: number of children num_children: 0 });
// This sample assumes the FB Pixel base code is already loaded fbq('track', 'ViewContent', { // Fire the 'ViewContent' event on the hotel details page // IF YOU CHOOSE NOT TO USE A RECOMMENDED PARAM, THEN REMOVE IT, DON'T LEAVE IT EMPTY // RECOMMENDED: set to 'hotel' content_type: 'hotel', // HIGHLY RECOMMENDED: checkin 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 checkin_date: '2018-04-01', // HIGHLY RECOMMENDED: checkout date // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD checkout_date: '2018-04-05', // REQUIRED: content id of hotel that is shown content_ids: '123', // 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 FB 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 // RECOMMENDED: set to 'hotel' content_type: 'hotel', // HIGHLY RECOMMENDED: checkin 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 checkin_date: '2018-04-01', // HIGHLY RECOMMENDED: checkout date // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD checkout_date: '2018-04-05', // REQUIRED: content id of hotel that being booked content_ids: '123', // 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 FB Pixel base code is already loaded fbq('track', 'Purchase', { // Fire the 'Purchase' event on the booking confirmed page // IF YOU CHOOSE NOT TO USE A RECOMMENDED PARAM, THEN REMOVE IT, DON'T LEAVE IT EMPTY // RECOMMENDED: set to set to 'hotel' content_type: 'hotel', // HIGHLY RECOMMENDED: checkin 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 checkin_date: '2018-04-01', // HIGHLY RECOMMENDED: checkout date // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD checkout_date: '2018-04-05', // REQUIRED: content id of hotel that was booked content_ids: '123', // RECOMMENDED: city, don't use abbreviations city: 'New York', // RECOMMENDED: region, don't use abbreviations region: 'New York', // RECOMMENDED: country country: 'United States', // RECOMMENDED: number of adults num_adults: 1, // RECOMMENDED: number of children num_children: 0, // REQUIRED: total value of booking value: 1200, // REQUIRED: currency of booking currency: 'USD' });
このガイドは、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 // RECOMMENDED: set to 'hotel' parameters.putString(AppEventsConstants.EVENT_PARAM_CONTENT_TYPE, "hotel"); // RECOMMENDED: content ids - include eg top 5 search results parameters.putString(AppEventsConstants.EVENT_PARAM_CONTENT_ID, "[\"123\", \"234\", \"345\", \"456\", \"567\"]"); // top search results // HIGHLY RECOMMENDED: checkin 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_checkin_date", "2018-04-01"); // HIGHLY RECOMMENDED: checkout date // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD parameters.putString("fb_checkout_date", "2018-04-05"); // 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: 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 // RECOMMENDED: set to 'hotel' parameters.putString(AppEventsConstants.EVENT_PARAM_CONTENT_TYPE, "hotel"); // REQUIRED: content id of hotel that is shown parameters.putString(AppEventsConstants.EVENT_PARAM_CONTENT_ID, "123"); // HIGHLY RECOMMENDED: checkin 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_checkin_date", "2018-04-01"); // HIGHLY RECOMMENDED: checkout date // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD parameters.putString("fb_checkout_date", "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 hotel 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 // RECOMMENDED: set to 'hotel' parameters.putString(AppEventsConstants.EVENT_PARAM_CONTENT_TYPE, "hotel"); // REQUIRED: content id of hotel that is being booked parameters.putString(AppEventsConstants.EVENT_PARAM_CONTENT_ID, "123"); // HIGHLY RECOMMENDED: checkin 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_checkin_date", "2018-04-01"); // HIGHLY RECOMMENDED: checkout date // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD parameters.putString("fb_checkout_date", "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 '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 // RECOMMENDED: set to 'hotel' parameters.putString(AppEventsConstants.EVENT_PARAM_CONTENT_TYPE, "hotel"); // REQUIRED: content id of hotel that was booked parameters.putString(AppEventsConstants.EVENT_PARAM_CONTENT_ID, "123"); // HIGHLY RECOMMENDED: checkin 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_checkin_date", "2018-04-01"); // HIGHLY RECOMMENDED: checkout date // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD parameters.putString("fb_checkout_date", "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); // 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: DO NOT change this, must be set to 'hotel' FBSDKAppEventParameterNameContentType : @"hotel", // RECOMMENDED: content ids - include eg top 5 search results FBSDKAppEventParameterNameContentID : @"[\"123\", \"234\", \"345\", \"456\", \"567\"]", // HIGHLY RECOMMENDED: checkin 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_checkin_date" : @"2018-04-01", // HIGHLY RECOMMENDED: checkout date // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD @"fb_checkout_date" : @"2018-04-15", // 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: number of adults @"fb_num_adults" : @1, // RECOMMENDED: number of children @"fb_num_children" : @0 } ];
// Fire the 'ViewContent' event on the hotel 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: DO NOT change this, must be set to 'hotel' FBSDKAppEventParameterNameContentType : @"hotel", // REQUIRED: content id of hotel that is shown FBSDKAppEventParameterNameContentID : @"123", // HIGHLY RECOMMENDED: checkin 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_checkin_date" : @"2018-04-01", // HIGHLY RECOMMENDED: checkout date // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD @"fb_checkout_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: DO NOT change this, must be set to 'hotel' FBSDKAppEventParameterNameContentType : @"hotel", // REQUIRED: content id of hotel that is shown FBSDKAppEventParameterNameContentID : @"123", // HIGHLY RECOMMENDED: checkin 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_checkin_date" : @"2018-04-01", // HIGHLY RECOMMENDED: checkout date // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD @"fb_checkout_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 'Purchase' event when the booking is confirmed // total value of booking [[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: DO NOT change this, must be set to 'hotel' FBSDKAppEventParameterNameContentType : @"hotel", // REQUIRED: content id of hotel that is shown FBSDKAppEventParameterNameContentID : @"123", // HIGHLY RECOMMENDED: checkin 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_checkin_date" : @"2018-04-01", // HIGHLY RECOMMENDED: checkout date // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD @"fb_checkout_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 } ];
モバイルでは、パラメーターの名前がFacebookピクセルと異なります。多くの場合、先頭にfb_
が付きます(例: content_ids
に対してfb_content_id
)。ただし、いくつかの例外があります(例: value
に対して_valueToSum
)。
content_ids
やcontent_type
などで複数の値を渡す場合は、JSONエンコードされた値の配列'["value1", "value2"]'
を指定します。値をコンマで連結しないでください。
パラメーターの名前と型 | 説明 |
---|---|
型: 文字列 | 強く推奨。 利用者がホテルへのチェックインを希望している、ホテルのタイムゾーンでの日付です。 例:
|
型: 文字列 | 強く推奨。 利用者がホテルからのチェックアウトを希望している、ホテルのタイムゾーンでの日付です。有効な日付形式は |
型: 文字列または文字列[] |
旅行カタログに掲載されている関連ID。例えば、 例:
|
型: 文字列または文字列[] | 推奨。 常に |
型: 文字列 |
利用者の意図した場所の都市を提供します。 例: |
型: 文字列 |
利用者の意図した場所の州、地区、地域を提供します。 例: |
型: 文字列 |
利用者の意図した場所の国を提供します。 例: |
型: 浮動小数 |
予約の合計金額(広告主にとってのイベントの価値を表す数値)です。 例: |
型: 文字列 |
例: |
型: 文字列または文字列[] | 目的地カタログがある場合は、目的地カタログ内の1つ以上の目的地を、特定のホテルイベントと関連付けることができます。例えば、あるホテルを、目的地カタログ内の目的地である、付近の博物館や近くのビーチとリンクさせることができます。 例: |
型: 浮動小数 | 他のホテルと比較した場合の、広告主にとってのホテルの相対価値を示す指標です。 例: |
型: 文字列 | 宿泊予定の大人の人数です。指定した場合、テンプレートタグによる広告でこれらの情報を使用できます。 例: |
型: 整数 | 宿泊予定の子供の人数です。指定した場合、テンプレートタグによる広告でこれらの情報を使用できます。 例: |
型: 文字列[] | 利用者がフィルタリングする、希望する近隣ランドマークのリストです。 例: |
型: [整数(最低),整数(最高)] | 利用者がフィルタリングする、宿泊料金の下限と上限のタプルです。 例 |
型: [整数(最低),整数(最高)] | 利用者がフィルタリングする、ホテルのスター評価の最低と最高のタプルです。 例 |
型: 浮動小数 | 広告主にとっての利用者の相対価値を示す指標です。 例: |