航班廣告 - 事件

航班廣告會使用四種事件。每種事件都有一組參數,請參閱事件參數詳細資料。在網站上使用 Facebook 像素,也可在 Android 應用程式iOS 應用程式中使用行動應用程式事件。

事件觸發時機程式碼範例

Search

在航班搜尋結果頁面

像素AndroidiOS

ViewContent

用戶已選擇航班時

像素AndroidiOS

InitiateCheckout

用戶進入付款畫面時

像素AndroidiOS

Purchase

在預訂確認頁面

像素AndroidiOS

網站專用的 Facebook 像素

這份指南會假設您已安裝 Facebook 像素。如尚未安裝,請參閱針對像素使用行銷 API

請在觸發事件時,確定已載入像素基底程式碼。如果使用標籤管理員,請務必將內含像素程式碼的標籤包括在每個網頁中。這個標籤應該顯示在內含像素事件程式碼的標籤之前。請利用 Facebook 像素協助工具驗證您的像素實作方式。

Search 像素事件

// This sample assumes the Facebook pixel base code is already loaded

fbq('track', 'Search', {
  // Fire the 'Search' event on the search results page

  // IF YOU DO NOT TO USE A RECOMMENDED PARAM, THEN REMOVE, DON'T LEAVE EMPTY

  // RECOMMENDED: set to 'flight'
  content_type: 'flight',

  // HIGHLY RECOMMENDED: departure 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
  departing_departure_date: '2018-12-12',

  // HIGHLY RECOMMENDED: return date, in case of round trip, remove otherwise
  // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD
  returning_departure_date: '2018-12-19',

  // REQUIRED: use official IATA code of departure airport
  origin_airport: 'SFO',

  // REQUIRED: use official IATA code of destination airport
  destination_airport: 'JFK',

  // RECOMMENDED: arrival date of departure flight
  // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD
  departing_arrival_date: '2018-12-12',

  // RECOMMENDED: arrival date of return flight
  // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD
  returning_arrival_date: '2018-12-20',

  // RECOMMENDED: number of adults on flight
  num_adults: 1,

  // RECOMMENDED: number of children on flight
  num_children: 0,

  // RECOMMENDED: number of infants
  num_infants: 0,

  // RECOMMENDED: travel class
  // must be 'economy', 'premium', 'business' or 'first'
  travel_class : 'economy',

  // RECOMMENDED: price for the flight
  // Use lowest price if you show multiple options on this page
  // Should not include cost of extras, such as seat selection, extra luggage
  price : 100,

  // RECOMMENDED: currency of the flight price
  // Must match currency of catalog
  currency: 'USD'
});

ViewContent 像素事件

// This sample assumes the FB Pixel base code is already loaded

fbq('track', 'ViewContent', {
  // Fire the 'ViewContent' event when the user has selected the flight(s)

  // IF YOU DO NOT TO USE A RECOMMENDED PARAM, REMOVE IT, DON'T LEAVE EMPTY

  // RECOMMENDED: set to 'flight'
  content_type: 'flight',

  // HIGHLY RECOMMENDED: departure 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
  departing_departure_date: '2018-12-12',

  // HIGHLY RECOMMENDED: return date, in case of round trip, remove otherwise
  // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD
  returning_departure_date: '2018-12-19',

  // REQUIRED: use official IATA code of departure airport
  origin_airport: 'SFO',

  // REQUIRED: use official IATA code of destination airport
  destination_airport: 'JFK',

  // RECOMMENDED: arrival date of departure flight
  // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD
  departing_arrival_date: '2018-12-12',

  // RECOMMENDED: arrival date of return flight
  // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD
  returning_arrival_date: '2018-12-20',

  // RECOMMENDED: number of adults on flight
  num_adults: 1,

  // RECOMMENDED: number of children on flight
  num_children: 0,

  // RECOMMENDED: number of infants
  num_infants: 0,

  // RECOMMENDED: travel class
  // must be 'economy', 'premium', 'business' or 'first'
  travel_class : 'economy'
});

InitiateCheckout 事件

// Assumes FB Pixel base code already loaded

fbq('track', 'InitiateCheckout', {
  // Fire the 'InitiateCheckout' event when the user enters the payment screen

  // IF YOU DO NOT TO USE A RECOMMENDED PARAM, THEN REMOVE, DON'T LEAVE IT EMPTY

  // RECOMMENDED: set to 'flight'
  content_type: 'flight',

  // HIGHLY RECOMMENDED: departure 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
  departing_departure_date: '2018-12-12',

  // HIGHLY RECOMMENDED: return date, in case of round trip, remove otherwise
  // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD
  returning_departure_date: '2018-12-19',

  // REQUIRED: use official IATA code of departure airport
  origin_airport: 'SFO',

  // REQUIRED: use official IATA code of destination airport
  destination_airport: 'JFK',

  // RECOMMENDED: arrival date of departure flight
  // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD
  departing_arrival_date: '2018-12-12',

  // RECOMMENDED: arrival date of return flight
  // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD
  returning_arrival_date: '2018-12-20',

  // RECOMMENDED: number of adults on flight
  num_adults: 1,

  // RECOMMENDED: number of children on flight
  num_children: 0,

  // RECOMMENDED: number of infants
  num_infants: 0,

  // RECOMMENDED: travel class
  // must be 'economy', 'premium', 'business' or 'first'
  travel_class : 'economy'
});

Purchase 事件

// Assumes FB Pixel base code already loaded

fbq('track', 'Purchase', {
  // Fire the 'Purchase' event on the booking confirmed page

  // IF YOU DO NOT TO USE A RECOMMENDED PARAM, REMOVE IT, DON'T LEAVE EMPTY

  // RECOMMENDED: set to 'flight'
  content_type: 'flight',

  // HIGHLY RECOMMENDED: departure 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
  departing_departure_date: '2018-12-12',

  // HIGHLY RECOMMENDED: return date, in case of round trip, remove otherwise
  // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD
  returning_departure_date: '2018-12-19',

  // REQUIRED: use official IATA code of departure airport
  origin_airport: 'SFO',

  // REQUIRED: use official IATA code of destination airport
  destination_airport: 'JFK',

  // RECOMMENDED: arrival date of departure flight
  // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD
  departing_arrival_date: '2018-12-12',

  // RECOMMENDED: arrival date of return flight
  // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD
  returning_arrival_date: '2018-12-20',

  // RECOMMENDED: number of adults on flight
  num_adults: 1,

  // RECOMMENDED: number of children on flight
  num_children: 0,

  // RECOMMENDED: number of infants
  num_infants: 0,

  // RECOMMENDED: travel class
  // must be 'economy', 'premium', 'business' or 'first'
  travel_class : 'economy',

  // REQUIRED: Currency of payment
  // Must match currency of catalog
  currency: 'USD',

  // Total payment amount: flight price + extras + payment charges etc
  value: 150
});

Android 行動應用程式事件

這份指南會假設您已在 Android 行動應用程式實作 Facebook SDK。如尚未實作,請參閱 Android SDK。如使用衡量合作夥伴,請確定合作夥伴是否將必要事件傳遞給 Facebook。

Search Android 事件

Bundle parameters = new Bundle();
// IF YOU DO NOT USE A RECOMMENDED PARAM, REMOVE IT, DON'T LEAVE IT EMPTY

// RECOMMENDED: set to 'flight'
parameters.putString(AppEventsConstants.EVENT_PARAM_CONTENT_TYPE, "flight");

// HIGHLY RECOMMENDED: departure 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_departing_departure_date", "2018-12-12");

// HIGHLY RECOMMENDED: return date, in case of round trip, remove otherwise
// use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD
parameters.putString("fb_returning_departure_date", "2018-12-19");

// REQUIRED: use official IATA code of departure airport
parameters.putString("fb_origin_airport", "SFO");

// REQUIRED: use official IATA code of destination airport
parameters.putString("fb_destination_airport", "JFK");

// RECOMMENDED: arrival date of departure flight
// use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD
parameters.putString("fb_departing_arrival_date", "2018-12-12");

// RECOMMENDED: arrival date of return flight
// use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD
parameters.putString("fb_returning_arrival_date", "2018-12-20");

// RECOMMENDED: number of adults on flight
parameters.putInt("fb_num_adults", 1);

// RECOMMENDED: number of children on flight
parameters.putInt("fb_num_children", 0);

// RECOMMENDED: number of infants
parameters.putInt("fb_num_infants", 0);

// RECOMMENDED: travel class
// must be 'economy', 'premium', 'business' or 'first'
parameters.putString("fb_travel_class", "economy");

// RECOMMENDED: price for the flight
// Use lowest price if you show multiple options on this page
// Should not include cost of extras (seat selection, extra luggage etc)
parameters.putFloat("fb_price", 100.00);

// RECOMMENDED: currency of the flight price
// Must match currency of catalog
parameters.putString("fb_currency", "USD");

// Fire the 'Search' event on the search results page
logger.logEvent(
  AppEventsConstants.EVENT_NAME_SEARCHED,
  parameters
);

ViewContent Android 事件

Bundle parameters = new Bundle();
// IF YOU DO NOT USE A RECOMMENDED PARAM, REMOVE IT, DON'T LEAVE EMPTY

// RECOMMENDED: set to 'flight'
parameters.putString(AppEventsConstants.EVENT_PARAM_CONTENT_TYPE, "flight");

// HIGHLY RECOMMENDED: departure 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_departing_departure_date", "2018-12-12");

// HIGHLY RECOMMENDED: return date, in case of round trip, remove otherwise
// use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD
parameters.putString("fb_returning_departure_date", "2018-12-19");

// REQUIRED: use official IATA code of departure airport
parameters.putString("fb_origin_airport", "SFO");

// REQUIRED: use official IATA code of destination airport
parameters.putString("fb_destination_airport", "JFK");

// RECOMMENDED: arrival date of departure flight
// use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD
parameters.putString("fb_departing_arrival_date", "2018-12-12");

// RECOMMENDED: arrival date of return flight
// use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD
parameters.putString("fb_returning_arrival_date", "2018-12-20");

// RECOMMENDED: number of adults on flight
parameters.putInt("fb_num_adults", 1);

// RECOMMENDED: number of children on flight
parameters.putInt("fb_num_children", 0);

// RECOMMENDED: number of infants
parameters.putInt("fb_num_infants", 0);

// RECOMMENDED: travel class
// must be 'economy', 'premium', 'business' or 'first'
parameters.putString("fb_travel_class", "economy");

 // Fire the 'ViewContent' event when the user has selected the flight
logger.logEvent(
  AppEventsConstants.EVENT_NAME_VIEWED_CONTENT,
  parameters
);

InitiateCheckout Android 事件

Bundle parameters = new Bundle();
// IF YOU DO NOT USE A RECOMMENDED PARAM, REMOVE IT, DON'T LEAVE EMPTY

// RECOMMENDED: set to 'flight'
parameters.putString(AppEventsConstants.EVENT_PARAM_CONTENT_TYPE, "flight");

// HIGHLY RECOMMENDED: departure 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_departing_departure_date", "2018-12-12");

// HIGHLY RECOMMENDED: return date, in case of round trip, remove otherwise
// use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD
parameters.putString("fb_returning_departure_date", "2018-12-19");

// REQUIRED: use official IATA code of departure airport
parameters.putString("fb_origin_airport", "SFO");

// REQUIRED: use official IATA code of destination airport
parameters.putString("fb_destination_airport", "JFK");

// RECOMMENDED: arrival date of departure flight
// use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD
parameters.putString("fb_departing_arrival_date", "2018-12-12");

// RECOMMENDED: arrival date of return flight
// use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD
parameters.putString("fb_returning_arrival_date", "2018-12-20");

// RECOMMENDED: number of adults on flight
parameters.putInt("fb_num_adults", 1);

// RECOMMENDED: number of children on flight
parameters.putInt("fb_num_children", 0);

// RECOMMENDED: number of infants
parameters.putInt("fb_num_infants", 0);

// RECOMMENDED: travel class
// must be 'economy', 'premium', 'business' or 'first'
parameters.putString("fb_travel_class", "economy");

// Fire the 'InitiateCheckout' event when the user enters the payment screen
logger.logEvent(
  AppEventsConstants.EVENT_NAME_INITIATED_CHECKOUT,
  parameters
);

Purchase Android 事件

// REQUIRED: total value of booking
BigDecimal purchaseAmount = BigDecimal.valueOf(1200);

// REQUIRED: currency of booking
Currency currency = Currency.getInstance("USD");

Bundle parameters = new Bundle();
// IF YOU DO NOT USE A RECOMMENDED PARAM, REMOVE IT, DON'T LEAVE IT EMPTY

// RECOMMENDED: set to 'flight'
parameters.putString(AppEventsConstants.EVENT_PARAM_CONTENT_TYPE, "flight");

// HIGHLY RECOMMENDED: departure 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_departing_departure_date", "2018-12-12");

// HIGHLY RECOMMENDED: return date, in case of round trip, remove otherwise
// use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD
parameters.putString("fb_returning_departure_date", "2018-12-19");

// REQUIRED: use official IATA code of departure airport
parameters.putString("fb_origin_airport", "SFO");

// REQUIRED: use official IATA code of destination airport
parameters.putString("fb_destination_airport", "JFK");

// RECOMMENDED: arrival date of departure flight
// use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD
parameters.putString("fb_departing_arrival_date", "2018-12-12");

// RECOMMENDED: arrival date of return flight
// use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD
parameters.putString("fb_returning_arrival_date", "2018-12-20");

// RECOMMENDED: number of adults on flight
parameters.putInt("fb_num_adults", 1);

// RECOMMENDED: number of children on flight
parameters.putInt("fb_num_children", 0);

// RECOMMENDED: number of infants
parameters.putInt("fb_num_infants", 0);

// RECOMMENDED: travel class
// must be 'economy', 'premium', 'business' or 'first'
parameters.putString("fb_travel_class", "economy");

// Use the built-in SDK method when the booking is confirmed
logger.logPurchase(
  purchaseAmount,
  currency,
  parameters
);

iOS 行動應用程式事件

這份指南會假設您已在 iOS 行動應用程式實作 Facebook SDK。如尚未實作,請參閱 iOS SDK。如使用衡量合作夥伴,請確定合作夥伴是否將必要事件傳遞給 Facebook。

Search iOS 事件

// Fire the 'Search' event on the search results page  
[[FBSDKAppEvents shared] logEvent:FBSDKAppEventNameSearched

  // IF YOU DO NOT USE A RECOMMENDED PARAM, REMOVE IT, DON'T LEAVE EMPTY
  parameters:@{

    // REQUIRED: DO NOT change this, must be set to 'flight'
    FBSDKAppEventParameterNameContentType : @"flight",

    // HIGHLY RECOMMENDED: departure 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_departing_departure_date" : @"2018-12-12",

    // HIGHLY RECOMMENDED: return date, in case of round trip, remove otherwise
    // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD
    @"fb_returning_departure_date" : @"2018-12-19",

    // REQUIRED: use official IATA code of departure airport
    @"fb_origin_airport" : @"SFO",

    // REQUIRED: use official IATA code of destination airport
    @"fb_destination_airport" : @"JFK",

    // RECOMMENDED: arrival date of departure flight
    // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD
    @"fb_departing_arrival_date" : @"2018-12-12",

    // RECOMMENDED: arrival date of return flight
    // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD
    @"fb_returning_arrival_date" : @"2018-12-20",

    // RECOMMENDED: number of adults on flight
    @"fb_num_adults" : @1,

    // RECOMMENDED: number of children on flight
    @"fb_num_children" : @0,

    // RECOMMENDED: number of infants
    @"fb_num_infants" : @0,

    // RECOMMENDED: travel class
    // must be 'economy', 'premium', 'business' or 'first'
    @"fb_travel_class" : @"economy",

    // RECOMMENDED: price for the flight
    // Use lowest price if you show multiple options on this page
    // Should not include cost of extras: seat selection, extra luggage etc
    @"fb_price" : @100.00,

    // RECOMMENDED: currency of the flight price
    // Must match currency of catalog
    @"fb_currency" : @"USD"
  }
];

ViewContent iOS 事件

// Fire 'ViewContent' event when the user selects the flight
[[FBSDKAppEvents shared] logEvent:FBSDKAppEventNameViewedContent

  // IF YOU DO NOT USE A RECOMMENDED PARAM, REMOVE IT, DON'T LEAVE EMPTY
  parameters:@{

    // DO NOT change this, must be set to 'flight'
    FBSDKAppEventParameterNameContentType : @"flight",

    // HIGHLY RECOMMENDED: departure 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_departing_departure_date" : @"2018-12-12",

    // HIGHLY RECOMMENDED: return date, in case of round trip, remove otherwise
    // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD
    @"fb_returning_departure_date" : @"2018-12-19",

    // REQUIRED: use official IATA code of departure airport
    @"fb_origin_airport" : @"SFO",

    // REQUIRED: use official IATA code of destination airport
    @"fb_destination_airport" : @"JFK",

    // RECOMMENDED: arrival date of departure flight
    // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD
    @"fb_departing_arrival_date" : @"2018-12-12",

    // RECOMMENDED: arrival date of return flight
    // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD
    @"fb_returning_arrival_date" : @"2018-12-20",

    // RECOMMENDED: number of adults on flight
    @"fb_num_adults" : @1,

    // RECOMMENDED: number of children on flight
    @"fb_num_children" : @0,

    // RECOMMENDED: number of infants
    @"fb_num_infants" : @0,

    // RECOMMENDED: travel class
    // must be 'economy', 'premium', 'business' or 'first'
    @"fb_travel_class" : @"economy"
  }
];

InitiateCheckout iOS 事件

// Fire 'InitiateCheckout' event when user reaches payment screen
[[FBSDKAppEvents shared] logEvent:FBSDKAppEventNameInitiatedCheckout

  // IF YOU DO NOT USE A RECOMMENDED PARAM, REMOVE IT, DON'T LEAVE EMPTY
  parameters:@{

     // REQUIRED: DO NOT change this, must be set to 'flight'
    FBSDKAppEventParameterNameContentType : @"flight",

    // HIGHLY RECOMMENDED: departure 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_departing_departure_date" : @"2018-12-12",

    // HIGHLY RECOMMENDED: return date, in case of round trip, remove otherwise
    // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD
    @"fb_returning_departure_date" : @"2018-12-19",

    // REQUIRED: use official IATA code of departure airport
    @"fb_origin_airport" : @"SFO",

    // REQUIRED: use official IATA code of destination airport
    @"fb_destination_airport" : @"JFK",

    // RECOMMENDED: arrival date of departure flight
    // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD
    @"fb_departing_arrival_date" : @"2018-12-12",

    // RECOMMENDED: arrival date of return flight
    // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD
    @"fb_returning_arrival_date" : @"2018-12-20",

    // RECOMMENDED: number of adults on flight
    @"fb_num_adults" : @1,

    // RECOMMENDED: number of children on flight
    @"fb_num_children" : @0,

    // RECOMMENDED: number of infants
    @"fb_num_infants" : @0,

    // RECOMMENDED: travel class
    // must be 'economy', 'premium', 'business' or 'first'
    @"fb_travel_class" : @"economy"
  }
];

Purchase iOS 事件

// Fire 'Purchase' event when the booking confirmed

// REQUIRED: total value of booking
[[FBSDKAppEvents shared] logPurchase:150

  // REQUIRED: currency of booking
  currency:@"USD"

  // IF YOU DO NOT USE A RECOMMENDED PARAM, REMOVE IT, DON'T LEAVE EMPTY
  parameters:@{

    // REQUIRED: DO NOT change this, must be set to 'flight'
    FBSDKAppEventParameterNameContentType : @"flight",

    // HIGHLY RECOMMENDED: departure date
    // 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_departing_departure_date" : @"2018-12-12",

    // HIGHLY RECOMMENDED: return date, in case of round trip, remove otherwise
    // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD
    @"fb_returning_departure_date" : @"2018-12-19",

    // REQUIRED: use official IATA code of departure airport
    @"fb_origin_airport" : @"SFO",

    // REQUIRED: use official IATA code of destination airport
    @"fb_destination_airport" : @"JFK",

    // RECOMMENDED: arrival date of departure flight
    // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD
    @"fb_departing_arrival_date" : @"2018-12-12",

    // RECOMMENDED: arrival date of return flight
    // use YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD or YYYY-MM-DDThh:mm:ssTZD
    @"fb_returning_arrival_date" : @"2018-12-20",

    // RECOMMENDED: number of adults on flight
    @"fb_num_adults" : @1,

    // RECOMMENDED: number of children on flight
    @"fb_num_children" : @0,

    // RECOMMENDED: number of infants
    @"fb_num_infants" : @0,

    // RECOMMENDED: travel class
    // must be 'economy', 'premium', 'business' or 'first'
    @"fb_travel_class" : @"economy"
  }
];

事件參數詳細資料

行動裝置上的參數名稱會和 Facebook 像素的參數名稱不同,前者通常前面會加上 fb_,但有少數例外,例如 value 相對於 _valueToSum

參數名稱和類型說明

content_type(FB 像素)

fb_content_type(應用程式事件)

類型:字串或字串[]

建議使用

必須為 flight。如果結合其他旅遊廣告產品(例如飯店),請使用 '["flight", "hotel"]'

departing_departure_date(FB 像素)

fb_departing_departure_date(應用程式事件)

類型:字串

強烈建議使用

去程的開始日期和時間,可接受的日期格式為 YYYYMMDDYYYY-MM-DDYYYY-MM-DDThh:mmTZDYYYY-MM-DDThh:mm:ssTZD。提供此參數時,您可透過範本標籤將其用於廣告中,然後在廣告受眾中使用預訂時段參數,根據旅遊日期鎖定用戶。

範例:

  • 20180623
  • 2018-06-23
  • 2017-06-23T15:30GMT
  • 2017-06-23T15:30:00GMT

returning_departure_date(Facebook 像素)

fb_returning_departure_date(應用程式事件)

類型:字串

強力建議來回行程使用。

回程的開始日期和時間,可接受的日期格式與 departing_departure_date 所列相同。提供此參數時,您可透過範本標籤將其用於廣告中,然後在廣告受眾中使用預訂時段參數,根據旅遊日期鎖定用戶。

currency(FB 像素)

fb_currency(應用程式事件)

類型:字串

若為 purchase,則為必要項目

value 的幣別。請以 ISO 4217 幣別格式指定。

範例:USD

value(FB 像素)

_valueToSum(應用程式事件)

類型:浮點數

若為 purchase,則為必要項目

預訂總價。這個數字可量化此事件對廣告商的價值。

範例:155

departing_arrival_date(Facebook 像素)

fb_departing_arrival_date(應用程式事件)

類型:字串

去程抵達目的地的日期和時間,使用的日期格式應與 departing_departure_date 所列相同。

returning_arrival_date(Facebook 像素)

fb_returning_arrival_date(應用程式事件)

類型:字串

回程的結束日期和時間,使用的日期格式應與 departing_departure_date 所列相同。

destination_ids(Facebook 像素)fb_destination_ids(應用程式事件)

類型:字串或字串[]

如果有目的地目錄,您可將目的地目錄中的一或多個目的地連結至特定航班事件。例如,可將特定航線連結至附近的博物館和沙灘,且這兩個都是目錄中的目的地。

範例:'["dest2", "dest5", "dest8"]'

num_adults(Facebook 像素)fb_num_adults(應用程式事件)

類型:字串

成人搭機人數。提供此參數時,您可透過範本標籤,使其顯示在廣告中。

範例:2

num_children(Facebook 像素)

fb_num_children(應用程式事件)

類型:整數

兒童搭機人數。提供此參數時,您可透過範本標籤,使其顯示在廣告中。

範例:2

num_infants(Facebook 像素)

fb_num_infants(應用程式事件)

類型:整數

嬰兒搭機人數。提供此參數時,您可透過範本標籤,使其顯示在廣告中。

範例:2

price(Facebook 像素)

fb_price(應用程式事件)

類型:浮點數

根據所選航線和日期,搜尋結果中顯示的最低價格。僅適用於 Search 事件。

範例:95

travel_class(Facebook 像素)

fb_travel_class(應用程式事件)

類型:字串

必須為 economypremiumbusinessfirst

範例:economy

user_score(Facebook 像素)

fb_user_score(應用程式事件)

類型:浮點數

代表這位潛在顧客對於廣告商的相對價值。

範例:50

preferred_num_stops(Facebook 像素)fb_preferred_num_stops(應用程式事件)

類型:整數

指出用戶搜尋時偏好的轉機次數;0 代表直達航班。

範例:0