Anúncios de destino – Eventos

Os anúncios de destino usam quatro eventos. Cada evento tem um conjunto de parâmetros (confira a lista completa na seção Detalhes dos parâmetros de evento). Use o Pixel da Meta no seu site. No caso de app para Android e para iOS, use os eventos de app para celular. Saiba mais sobre eventos personalizados e padrão.

EventoQuando dispararExemplo de código

Search

Na página de resultados de pesquisa de destino

Pixel, Android, iOS

ViewContent

Na página de detalhes do destino

Pixel, Android, iOS

InitiateCheckout

Quando o usuário acessa a tela de pagamento

Pixel, Android, iOS

Purchase

Na página de confirmação da compra

Pixel, Android, iOS

Pixel do Facebook (para sites)

Este guia presume que você já tenha um pixel do Facebook instalado. Caso contrário, veja Como usar a API de Marketing com o pixel

Ao disparar um evento, certifique-se de que o código básico do pixel já esteja carregado. Se você usar um gerenciador de tags, inclua a tags que contém o código do pixel em cada página. A tag deve aparecer antes da tag que contém o código de evento do pixel. Use o Auxiliar de Pixel do Facebook para validar a implementação do pixel.

Evento de pixel Search

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

Evento de pixel ViewContent

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

Evento de pixel InitiateCheckout

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

Evento de pixel Purchase

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

Eventos do Aplicativo Móvel para Android

Este guia presume que você tenha implementado o SDK do Facebook no seu aplicativo móvel para Android. Caso você não tenha feito isso, consulte o SDK do Android. Se você utiliza um parceiro de mensuração, verifique se ele transmite os eventos necessários para o Facebook.

Evento de Android Search

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

Evento de Android ViewContent

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

Evento de Android InitiateCheckout

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

Evento de Android Purchase

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

Eventos do Aplicativo Móvel para iOS

Este guia presume que você já tenha implementado o SDK do Facebook no seu aplicativo móvel para iOS. Caso não tenho feito isso, consulte o SDK do iOS. Se você utiliza um parceiro de mensuração, verifique se ele transmite os eventos necessários para o Facebook.

Evento de iOS Search

// 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
  }
];

Evento de iOS ViewContent

// 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
  }
];

Evento de iOS InitiateCheckout

// 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
  }
];

Evento de iOS Purchase

// 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
  }
];

Detalhes dos parâmetros de evento

Em dispositivos móveis, os nomes de parâmetros são diferentes dos exibidos no Pixel da Meta. Geralmente, são precedidos por fb_ com algumas exceções, como content_ids em vez de fb_content_id e value em vez de _valueToSum.

Ao enviar diversos valores com content_ids ou content_type, por exemplo, forneça uma matriz de valores codificada em JSON: '["value1", "value2"]'. Não concatene valores com uma vírgula.

Nome e tipo do parâmetroDescrição

travel_start (pixel)

fb_travel_start (app)

Tipo: string

Recomendado.

A data de início da viagem do usuário. Aceitamos datas nos formatos YYYYMMDD, YYYY-MM-DD, YYYY-MM-DDThh:mmTZD e YYYY-MM-DDThh:mm:ssTZD. Quando fornecido, esse parâmetro pode ser usado no anúncio por meio de tags de modelo. Também é possível fazer o direcionamento para pessoas com base nas datas de viagem delas usando a janela de reserva nos seus públicos.

Exemplos:

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

travel_end (pixel)

fb_travel_end (app)

Tipo: string

Recomendado.

A data de término da viagem do usuário. Aceitamos os mesmos formatos de data listados para travel_start. Quando fornecido, esse parâmetro pode ser usado no anúncio por meio de tags de modelo. Também é possível fazer o direcionamento para pessoas com base nas datas de viagem delas usando a janela de reserva nos seus públicos.

content_ids (pixel)

fb_content_id (app)

Tipo: string ou string[]

Recomendado para search e obrigatório para todos os outros.

Todos os IDs relevantes conforme listados no seu catálogo de viagens. Por exemplo, você pode enviar o ID do item apresentado para o evento ViewContent ou uma matriz dos IDs dos principais resultados da pesquisa para o evento Search.

Exemplos:

  • "1234"
  • '["1234", "2345", "3456"]'

content_type (pixel)

fb_content_type (app)

Tipo: string ou string[]

Recomendado.

Se enviado, deve ser destination. Se combinado com outro produto DAT (por exemplo, hotéis), use '["destination", "hotel"]'.

city (pixel)

fb_city (app)

Tipo: string

Obrigatório para search.

Forneça a cidade da localização da intenção do usuário.

Exemplo: Auckland

region (pixel)

fb_region (app)

Tipo: string

Obrigatório para search.

Forneça a região da localização da intenção do usuário.

Exemplo: Manhattan

country (pixel)

fb_country (app)

Tipo: string

Obrigatório para search.

Forneça o país da localização da intenção do usuário.

Exemplo: New Zealand

num_adults (pixel)

fb_num_adults (app)

Tipo: string

Número de adultos que viajarão. Quando fornecido, esse parâmetro pode ser usado por meio de tags de modelo.

Exemplo: 2

num_children (pixel)

fb_num_children (app)

Tipo: número inteiro

Número de crianças que viajarão. Quando fornecido, esse parâmetro pode ser usado por meio de tags de modelo.

Exemplo: 2

suggested_destinations (pixel)

fb_suggested_destinations (app)

Tipo: string ou string[ ]

Uma lista de IDs que representam sugestões de destino para esse usuário. Esse parâmetro não se aplica ao evento Search.

Exemplo: '["1234", "2345", "3456"]'

value (pixel)

valueToSum (app)

Tipo: float`

Obrigatório para compra. O preço total da reserva (um número que quantifica o valor desse evento para o anunciante).

Exemplo: 155

currency (pixel)

fb_currency (app)

Tipo: string

Obrigatório para a compra. Moeda para o valor. Especificação no formato de moeda ISO 4217.

Exemplo: USD