Implement a pixel and/or mobile SDK for dynamic ads for travel (destinations)
Set up or modify your pixel
Create a Facebook pixel
- Go to your Pixels tab in Events Manager.
- Click Create a Pixel.
- To finish creating your pixel, click Create in the box that appears.
Add the Facebook pixel to your website
Once you've created your pixel, you're ready to put the Facebook pixel code on your website. Choose the statement below that best fits how you make updates to your website's code for instructions:
If someone else updates the code in your website, then follow the steps below to email them instructions to set up the Facebook pixel on your site.
- Go to the Pixels tab in Ads Manager.
- Click Set Up Pixel
- Click Email Instructions to a Developer.
- Enter the recipient's email address.
- Click Send at the bottom of the page.
- Locate the header code for your website
- Copy the entire code and paste it in the header of your website
- Check that your code's working correctly
Go to your website's code and find the header of your website.
Paste the code at the bottom of the header section, just above the closing head tag.
Click Send Test Traffic after placing the code on your website to make sure your pixel's working properly. If your status says "Active", your base code has been installed correctly. This can take several minutes to update.
Select your platform or tag manager from this list for an even easier way to set up your pixel. If you can't see your platform here, then take a look at one of the other two ways of setting up your pixel above.
Website platforms:
Tag managers
Learn more about the benefits of using a third-party platform to set up your pixel.
In order to retarget customers at different stages of your purchase funnel, you must modify the Facebook pixel on selected pages. In addition to the code installed on all pages of your website, dynamic ads for travel for destinations require two custom data events to be added to different pages of your website. Work with your web developer to modify the Facebook pixel for each of the following pages:
- Search results pages
- Product pages
On each page, add the appropriate standard events. These standard events must be added exactly as described below, with no variations in spelling or case. Make sure that you're looking at the standard events for the type of inventory that you're using; in this case, you'd use the standard events for destinations.
Page | Event name | Required parameters | Recommended parameters |
---|---|---|---|
Edit your search result pages to capture destinations resulting from people's searches on your website. | Search | content_type, content_ids, city, region, country | suggested_destinations, travel_start, travel_end |
Edit your product pages to capture destination details for the specific destination that a person has viewed. | ViewContent | content_type, content_ids | city, region, country, suggested_destinations, travel_start, travel_end |
Refer to the developer website for definitions and more formatting requirements for pixel parameters.
Adding destination parameters to your hotel or flight pixel setup
If you've already implemented DAT for hotels or flights, you can quickly and easily add destination parameters to your existing pixel implementation. The only change required is to add the destination_ids parameter to the Search and ViewContent events. The destination_ids parameter should fire the destination_id corresponding to the destination of the hotel or the destination airport. For example, if the hotel is located in Los Angeles or the destination airport for the flight is LAX, then the destination_ids parameter should fire the destination_id corresponding to Los Angeles in your destination catalogue.
Many tag management providers have integrated with Facebook to make it easier to set up Custom Audiences from your website and dynamic ads. Please contact your tag management partner directly to learn how to modify your tag to work with Facebook's dynamic ads for travel. You can also place the Facebook pixel code directly on your site.
Verify your pixel implementation
We suggest two primary tools for verifying that your pixel has been set up correctly to use dynamic ads:
The Facebook Pixel Helper helps you to confirm that your Facebook pixels are working as expected. Using Pixel Helper, you can confirm if a Facebook pixel has been added to your website, what standard events are on which pages (e.g. Event ID: ViewContent) and which content_ids are being reported by clicking View Event Log.
Common issues uncovered while testing your pixel
- Matching your catalogue to your Facebook pixel: If you receive an error stating that the pixel couldn't find a catalogue, you'll need to fix your event sources in the catalogue settings. Associating your pixel or app tells Facebook which pixel or app will match which catalogue. To associate your pixel, navigate to the Settings page in Business Manager, click Product catalogues, select your catalogue and click Associate sources. Select the pixel or app that you'd like to map to this catalogue. If a different team member created the catalogue and then placed the Facebook pixel, you may need to grant admin access (required) to add/update a catalogue's settings.
You can download the Facebook Pixel Helper from the Chrome store.
The Retargeting Pixel Debug Tool helps you to debug the issues specifically related to retargeting. Once you enter your pixel ID, the tool will report all the Search, ViewContent, Purchase and InitiateCheckout events.
You can also use this tool to see all events fired for your user ID for the specified pixel ID. So you can visit a product page on your website that fires pixel events for the specified pixel ID and double-check if those pixels fired have been registered correctly when you visited that page.
Furthermore, to understand the retargeting of audiences, this tool allows you to enter an audience ID and check whether you're included in that audience to make sure that the audience rules are set up correctly and you're being correctly matched to the right audiences.
Try out the Retargeting Pixel Debug Tool in Business Manager.
Implementing the Facebook SDK for your mobile app
You need a Facebook App ID to use the Facebook SDK for iOS, Android or JavaScript (web). You can use an existing app if you already have one. If you do not have an existing app, use our Quick start to create a new one. If you need help, follow our guide on how to register and configure an app.
You will need to add the SDK to your app. Learn more in our getting started guide.
Prior to adding the SDK to your app, read the section below to also integrate the required app events for dynamic ads.
To dynamically retarget your app users with relevant products, the same four required events must be added to your app.
Event | App event |
---|---|
Search | fb_mobile_search |
ViewContent | fb_mobile_content_view |
InitiateCheckout | fb_mobile_initiated_checkout |
Purchase | fb_mobile_purchase |
For more details on adding these four custom data events, visit our developer site.
To ensure that your app events are being sent correctly, you can check your recent events in Facebook Analytics for Apps.
After you've added your pixel and events, you need to associated an event source group (the pixel) with your catalogue. If your setup includes multiple catalogues and pixels, make sure that you properly connect the right pieces together. You can match the pixels with the corresponding travel catalogue through Facebook Business Manager:
- In the assets menu, click on Product catalogues
- Select your catalogue
- Click on Catalogue settings in the top menu
- At event sources, click on Edit
- Assign pixels and apps to your catalogue
Complete your dynamic ad for travel (destinations):
* Nguồn: Facebook