Les publicités pour les destinations utilisent quatre évènements. Chaque évènement comporte un ensemble de paramètres (liste complète dans les détails des paramètres d’évènements). Utilisez le Pixel Meta sur votre site web, et les évènements d’application mobile dans votre application Android et votre application iOS. En savoir plus sur les évènements standard et personnalisés.
Évènement | Cas d’utilisation | Exemple de code |
---|---|---|
Search | Sur la page des résultats de recherche de destinations | |
ViewContent | Sur la page des détails des destinations | |
InitiateCheckout | Lorsqu’un·e utilisateur·ice arrive sur l’écran de paiement | |
Purchase | Sur la page de confirmation de l’achat |
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 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 });
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 // 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 );
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: 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 } ];
Sur appareil mobile, les noms de paramètres sont différents de ceux pour le Pixel Meta. Souvent précédés de fb_
, à quelques exceptions près, comme content_ids
par rapport à fb_content_id
ou value
par rapport à _valueToSum
.
Lorsque vous envoyez plusieurs valeurs, par exemple avec content_ids
ou content_type
, fournissez une série de valeurs codée JSON : '["value1", "value2"]'
. Ne concaténez pas les valeurs à l’aide d’une virgule.
Nom et type du paramètre | Description |
---|---|
type : chaîne | Recommandé. La date de début du voyage de l’utilisateur·ice. Les formats de date acceptés sont les suivants : Exemples :
|
type : chaîne | Recommandé. La date de fin du voyage de l’utilisateur·ice. 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é. S’il est envoyé, la valeur 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 Indiquez la région dans laquelle 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 : chaîne | Nombre d’adultes qui voyageront. Si ces informations sont fournies, vous pouvez les utiliser dans la publicité à l’aide de tags de modèle. Exemple : |
type : nombre entier | Nombre d’enfants qui voyageront. Si ces informations sont fournies, vous pouvez les utiliser dans la publicité à l’aide de tags de modèle. Exemple : |
type : chaîne ou chaîne[ ] | Une liste des identifiants représentant les suggestions de destination pour cet·te utilisateur·ice. Ce paramètre n’est pas applicable à l’évènement Exemple : |
type : virgule flottante | Achat obligatoire. Un 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 un achat. Devise utilisable pour la valeur. Spécifiée au format de devise ISO 4217. Exemple : |