How-To Track Multiple Countries On A Single Landing Page

 


 
How-To Track Multiple Countries On A Single Landing Page

A great way to save time building call campaigns is to track multiple countries on a single asset. In this guide, we’ll show you how.

Tracking multiple countries on a single landing page is a great to re-use campaign assets and save time when running your call campaigns.

If you do not have a basic understanding of HTML and PHP, this beginner’s guide is a great place to learn how easy it is to work with these tools. The best marketers have a solid foundation in web-based programming languages.

Note: Ringba doesn’t currently support number pools with numbers from different countries, so the first thing you will have to do is create multiple number pools and campaigns in our platform.

For this example we’ll assume you’re running an English campaign in 4 countries, have already generated your number pools and campaign IDs, and are able to segment your traffic by country from your traffic source with a URL variable.

Example Country Campaign IDs:

United States – Campaign ID: CA76996a75a6964ad7a37ba32c21e806e7
Canada – Campaign ID: CA44575a6911ad7ab7ba3f4gg94dg
United Kingdom – Campaign ID: CA111d55a6952az7437bass11gg94nn
Australia – Campaign ID: CA885b71a6964ad7a37ba3376gg94zz

Example Landing Page URLs:

Base – http://www.website.com/lp1/?geo=
United States – http://www.website.com/lp1/?geo=us
Canada – http://www.website.com/lp1/?geo=ca
United Kingdom – http://www.website.com/lp1/?geo=uk
Australia – http://www.website.com/lp1/?geo=au

Step 1: Grab country variable ‘geo’ from the URL using PHP

We’re using the $_GET[”] function to set the $geo variable with the value extracted from the URL, while using trim() to remove any extra accidental data. Our example does not correct for uppercase and lowercase data so you will need to make sure your geo= variable data is the same case as used below.

Step 2: Setup dynamic Campaign_ID insertion by ‘geo’ using a “Switch Case”

Now we need to set the Campaign ID dynamically by geo so we’ll use a ‘switch case‘.

We’ve set the default switch to the US Campaign ID. If there are any errors or missing data, the US campaign’s phone numbers will display.

Step 3: Dynamically insert geo Campaign ID using Ringba JS.

The last step to this process is making sure the proper Campaign ID is inserted into your Ringba JS code.

The ‘c’ variable needs to be updated with the $campaign_id variable we set in our PHP switch. We have 2 easy options to do that, a full PHP echo tag:

Your final Ringba JS tag will look like:

Alternative JQuery Implementation Code

If you prefer to use the more robust jQuery implementation, your final tag would look like:

 

Join Our Newsletter

Profitable marketing tactics, case studies, in-depth guides, and more. Enter your email address now.

close