航班廣告:事件

航班廣告會使用四種事件。每一種事件都有一組參數,請查看事件參數詳情。在您的網站上使用 Facebook 像素;在 Android 應用程式iOS 應用程式中使用流動應用程式事件。

事件觸發時機程式碼範例

Search

在航班搜尋結果頁面

PixelAndroidiOS

ViewContent

當用戶已選定航班時

PixelAndroidiOS

InitiateCheckout

當用戶進入付款畫面時

PixelAndroidiOS

Purchase

在預訂確認頁面

PixelAndroidiOS

Facebook Pixel (for Websites)

This guide assumes you already have a Facebook Pixel installed. If not, see Using Marketing API with the Pixel.

Make sure the pixel base code is already loaded when you fire an event. If you use a tag manager, make sure you include the tag that contains the pixel code on every page. The tag should appear before the tag that contains the pixel event code. Use the Facebook Pixel Helper to validate your pixel implementation.

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
});

Mobile App Events for Android

This guide assumes you have the Facebook SDK implemented in your Android mobile app. If not, see the Android SDK. If you use a measurement partner, make sure they pass required events to 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