How to set up Google Analytics for the White Label

To track the number of clicks on the «Buy» button in your Travelpayouts White Label, or the number of referrals to specific offers, you can use the special services: Google Analytics or something similar.

1. Initiate jQuery. To do this, place the code in the Meta tab:

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>

2. Go to Google Analytics and create a new Website Tracking code. Copy the tracking code and paste it into the White Label settings in the Header tab.

2017-10-11_11-46-48.png

3. Add labels with identifiers to the tracker: BUY_BUTTON, DEEPLINK for flight results and HOTELS_BUY_BUTTON, HOTELS_BUY_LINK for hotels in the settings of Google Analytics goals. More information about goals you can find here.

BUY_BUTTON, HOTELS_BUY_BUTTON — will consider clicking on the «Buy» button in flight and hotels result page.

DEEPLINK, HOTELS_BUY_LINK — will consider clicking on links leading to agency websites.

2017-10-11_11-51-35.png

4. Open the White Label section. Create a new one or open an existing White Label for editing. Go to the Footer tab and add the following code:

<script>
$(document).on(«click»,».ticket-action-airline»,function(){
ga('send', 'event', 'AVIA_BUY_BUTTON');
});
$(document).on(«click»,».main-proposal-link»,function(){
ga('send', 'event', 'AVIA_BUY_BUTTON');
});
$(document).on(«click»,».ticket-action-button-deeplink»,function(){
ga('send', 'event', 'AVIA_BUY_BUTTON');
});
$(document).on(«click»,».ticket-action-proposals-item-link»,function(){
ga('send', 'event', 'AVIA_BUY_LINK');
});
$(document).on(«click»,».main_gate-button»,function(){
ga('send', 'event', 'HOTELS_BUY_BUTTON');
});
$(document).on(«click»,».card-gates_list__name»,function(){
ga('send', 'event', 'HOTELS_BUY_LINK');
});
</script>

5. Save changes in the White Label.

Detailed documentation is available on Google.

Was this article helpful?

Have more questions? Submit a request