Looking for an easy way to geotarget WPBakery Page Builder content on WordPress?
WPBakery Page Builder, previously known as Visual Composer, makes it easy to create custom designs using a visual, drag-and-drop interface. But what if you want to display different designs or different elements to visitors based on visitors' geolocations?
In this article, you're going to learn how to geotarget WPBakery Page Builder content using GeotargetingWP and the Geotargeting Pro plugin. With GeotargetingWP, you'll get new WPBakery elements that let you add geotargeting directly to your designs - no code required and without leaving the WPBakery Page Builder interface.
The geotargeting elements basically work like containers (e.g. a row or column). When you add the element, you can choose which locations to target. Then, all of the other elements inside the geotargeting element will use those geotargeting rules. For example, if you tell an element to target visitors from the USA, all of the elements inside will only display to people browsing from the USA.
You can then repeat as many times as needed to set up as many geotargeting rules as needed.
Keep reading and we'll show you how to set everything up!
How to Geotarget WPBakery Page Builder Content
To set up this functionality, you'll need the Geotargeting Pro plugin from GeotargetingWP. Geotargeting Pro lets you add geotargeting rules to any part of your WordPress site. It works with full or partial posts and pages, menu items, widgets, and - you guessed it - WPBakery Page Builder content.
The plugin itself is free, but you'll need to subscribe to the GeotargetingWP service, which is what lets you accurately discover your visitors' locations. However, you can get a 14-day free trial with no credit card required, so you'll be able to follow this entire tutorial for free and without entering any payment information.
Step 1. Configure the Geotargeting Pro plugin
To get started, you'll need to register for a Geotargeting WP account - remember, you get a 14-day free trial with no credit card required.
Once you create your account, download the latest version of the GeotargetingWP plugin from the sidebar of your account dashboard:
Then, install and activate the plugin on your WordPress site.
Once you activate the plugin on WordPress, it will launch a setup wizard to help you get started.
In the first tab, you'll need to add your API key and API secret. You can find these keys in the API key area of your GeotargetingWP dashboard.
In the API key area in your GeotargetingWP dashboard, you'll also want to add your WordPress website to the "Allowed domains" box:
Then, go back to your WordPress dashboard and add both API keys to the setup wizard. Then, you'll also need to make two choices:
- Fallback Country - if GeotargetingWP is unable to detect a visitor's IP for some reason, it will treat the visitor as if they were from this country.
- Bots Country - GeotargetingWP will treat bots and crawlers (like Googlebot) as if they're visiting from this country.
Then, click Next.
On the next page, you can install some of GeotargetingWP's additional add-ons. You can install any that seem interesting, but you don't need to use any add-ons to geotarget WPBakery Page Builder content.
Click Next when you've made your choices.
On the last page, you can choose whether or not to help GeotargetingWP with anonymous usage data. Then, click Next to finish the setup.
2. Add a Geotargeting Element in WPBakery Page Builder
As we mentioned in the introduction, GeotargetingWP works by adding new geotargeting elements to WPBakery Page Builder. These elements are containers, just like rows and columns. Any elements that you add inside the geotargeting elements will use the geotargeting rules of the parent container.
To kick things off, you need to add your first geotargeting element. Open the Add Element inserter and search for "target". This will show you all four of GeotargetingWP's blocks - you can target by:
For this example, let's say that you want to only show content to visitors from Vietnam. You would add a Target Countries element.
This will open the element's settings. Here, you can enter the country(s) that you want to target, separated by commas. You can either use the country name or its ISO code:
GeotargetingWP also lets you set up something called "Regions". These are basically pre-set groups of countries (or other locations) that you can use to quickly apply rules. GeotargetingWP includes its own default regions for Africa, Asia, etc. However, you can also create your own custom regions as needed.
Also, note that you can use both include and exclude rules:
- Include (Country, Region) - content inside this block will only show to visitors from this area(s).
- Exclude (Exclude Country, Exclude Region) - content inside this block will show to all visitors except for visitors from this area(s).
So let's build on that example and say you want to set up the following:
- Show one button to visitors in Vietnam
- Show another button to visitors from everywhere except Vietnam
You would then add another Target Countries element. But this time, you would set up the Exclude Country rule as "Vietnam":
Now, you have two elements as follows:
You could of course add more elements if needed - we're only limiting it to two to keep things simple.
3. Add Content Inside the Geotargeting Elements
Next, you need to add the content that you want to geotarget inside the relevant geotargeting element. You can use any of WPBakery Page Builder's elements and you can add as many elements as needed.
For example, let's say you want to geotarget a button element. You can see that the button is nested inside the Target countries element:
And that's it! You just learned how to geotarget content in WPBakery Page Builder.
If you want to add more geotargeted content or set up additional rules, you can just repeat the same process using the same principles that you learned above.
Will These Geotargeting Rules Work With Page Caching?
Yes! Even if you're using page caching from a plugin or your host, GeotargetingWP still works. Just make sure to enable Ajax mode in the plugin's settings.
Start Geotargeting WPBakery Page Builder Today
By geotargeting your WPBakery Page Builder designs, you'll be able to create more optimized experiences for visitors in different countries.
To start geotargeting WPBakery Page Builder without needing any code or special technical knowledge, sign up for a GeotargetingWP account today and start your 14-day free trial.
Powered by Froala Editor