Les publicités hôtelières utilisent quatre évènements. Chaque évènement comporte un ensemble de paramètres (liste complète des détails des paramètres d’évènements). Vous pouvez utiliser le pixel Facebook sur votre site Web et les évènements d’application mobiles dans votre application Android et votre application iOS.
Évènement | Cas d’utilisation | Exemple de code |
---|---|---|
Search | Sur la page des résultats de recherche d’hôtels | |
ViewContent | Sur la page des détails des hôtels | |
InitiateCheckout | Lorsque l’utilisateur·ice arrive sur l’écran de paiement | |
Purchase | Sur la page de confirmation de réservation |
Ce guide suppose que vous avez déjà installé un pixel Facebook. Si ce n’est pas le cas, consultez Utilisation de l’API Marketing avec le pixel.
Vérifiez que le code de base du pixel est déjà chargé lorsque vous déclenchez un évènement. Si vous utilisez un gestionnaire de balises, veillez à inclure la balise contenant le code de pixel sur chaque page. La balise doit apparaître avant celle qui contient le code d’évènement de pixel. Utilisez l’outil Facebook Pixel Helper pour valider l’implémentation de votre pixel.
// 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' });
Ce guide suppose que vous avez implémenté le SDK Facebook dans votre application mobile Android. Si ce n’est pas le cas, consultez SDK Android. Si vous avez recours à un partenaire de mesure, assurez-vous qu’il transmette les évènements requis à 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 );
Ce guide suppose que vous avez déjà implémenté le SDK Facebook dans votre application mobile iOS. Si ce n’est pas le cas, consultez SDK iOS. Si vous avez recours à un partenaire de mesure, assurez-vous qu’il transmet les évènements requis à 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 } ];
Sur appareil mobile, les noms de paramètres sont différents de ceux pour le pixel Facebook. Souvent précédés de fb_
, à quelques exceptions près, comme content_ids
et fb_content_id
ou value
et _valueToSum
.
Lorsque vous envoyez plusieurs valeurs, par exemple avec content_ids
ou content_type
, fournissez une série de valeurs codée en JSON : '["value1", "value2"]'
. Ne concaténez pas les valeurs à l’aide d’une virgule.
Nom et type du paramètre | Description |
---|---|
type : chaîne | Fortement recommandé. Date à laquelle l’utilisateur·ice souhaite arriver à l’hôtel, dans le fuseau horaire de l’établissement. Les formats de date acceptés sont : Exemples :
|
type : chaîne | Fortement recommandé. Date à laquelle l’utilisateur·ice souhaite quitter l’hôtel, dans le fuseau horaire de l’établissement. Nous acceptons les mêmes formats de date que pour le paramètre |
type : chaîne ou chaîne[] | Recommandé pour Tous les ID pertinents répertoriés dans votre catalogue de voyages. Par exemple, pour l’évènement Exemples :
|
type : chaîne ou chaîne[] | Recommandé. Doit être |
type : chaîne | Obligatoire pour Fournissez la ville dans laquelle se trouve le lieu d’après l’intention de l’utilisateur·ice. Exemple : |
type : chaîne | Obligatoire pour Fournissez l’État, la circonscription ou la région où se trouve le lieu d’après l’intention de l’utilisateur·ice. Exemple : |
type : chaîne | Obligatoire pour Fournissez le pays dans lequel se trouve le lieu d’après l’intention de l’utilisateur·ice. Exemple : |
type : virgule flottante | Obligatoire pour Prix total de la réservation (un nombre qui quantifie la valeur de cet évènement pour l’annonceur). Exemple : |
type : chaîne | Obligatoire pour Devise pour le paramètre Exemple : |
type : chaîne ou chaîne[] | Si vous possédez un catalogue de destinations, vous pouvez associer une ou plusieurs destinations à votre catalogue de destinations à l’aide d’un évènement hôtelier spécifique. Par exemple, un hôtel particulier peut être relié à un musée et une plage à proximité, tous deux étant des destinations du catalogue de destinations. Exemple : |
type : virgule flottante | Indicateur représentant la valeur relative de cet hôtel pour l’annonceur par rapport à ses autres hôtels. Exemple : |
type : chaîne | Nombre d’adultes qui prendront part au séjour. Si ces informations sont fournies, vous pouvez les utiliser dans la publicité par le biais de balises de modèle. Exemple : |
type : nombre entier | Nombre d’enfants qui prendront part au séjour. Si ces informations sont fournies, vous pouvez les utiliser dans la publicité par le biais de tags de modèle. Exemple : |
type : chaîne[] | Liste des quartiers préférés que l’utilisateur·ice a sélectionnés pour le filtrage. Exemple : |
type : [nombre entier (min), nombre entier (max)] | Tuple de prix minimum et maximum par chambre que l’utilisateur·ice a sélectionnés pour le filtrage. Exemple : |
type : [nombre entier (min), nombre entier (max)] | Tuple de nombres d’étoiles minimum et maximum par hôtel que l’utilisateur·ice a sélectionnés pour le filtrage. Exemple : |
type : virgule flottante | Indicateur représentant la valeur relative de cet utilisateur·ice pour l’annonceur. Exemple : |