Hostel PRO Conversion Tracking with Google AdWords

While this guide will show you how to implement conversion tracking with Google AdWords, the same principle can be applied for any other conversion tracking code.

From version 1.7.2 the hostel / BnB plugin Hostel PRO supports handling an “onclick” conversion  tracking  code in the Settings page.

OnClick Tracking Code?

Because HostelPRO works explicitly with Ajax, you need to use conversion tracking code that gets executed on button click, rather than code which automatically get executed on page load. The code that you set up in the Hostel PRO Settings page will be executed when the booking form is submitted successfully by the user.

Note that if your hostel requires partial payment on booking, the conversion gets tracked at the time when the payment buttons are shown. It will not wait for the payment to be made or validated.

So to complete conversion tracking  with Google AdWords you need just two steps:

Step 1: Add Google AdWords Tracking Code To Your Pages

If you are using conversion tracking  you have probably done this already. You need to get the AdWords scripts and insert them as shown here in section “Tracking clicks on links or buttons as conversions”.

Step 2: Add The OnClick Handler In Your Hostel PRO Settings Page

The code that you need to add is just “goog_report_conversion()”. No need to add URL in the function:

conversion-tracking

That’s it.

You can use this field to add any other javascript code that you want to be executed upon completing your form. It is your responsibility to add only valid javascript code.

Please also note that any JS code added here will be eval’d. Don’t give access to your WP administration to people you don’t trust.