This article will walk you through how to create IP geolocation personalization using Sitecore without any custom components. Read on to learn how to test whether or not your Geo IP service is working and simultaneously, how to add this type of personalization to your site.

Simple IP Geolocation personalization with Sitecore 8.2

In this Geo IP personalization example, we'll create a page that displays a Brazilian flag to visitors in Brazil and a default version for visitors from anywhere else. 

Steps:

1. Login into Sitecore as admin. (Note: this is a basic Sitecore build that only includes what comes with the installation. No other user but the admin was created)

2. Upload a Brazilian flag image to the media library.

3.
In the Content Editor, navigate to the Home item.

4. Create two items using the Sample Item template. Name the first one "default" and the other one "from-brazil".

Sitecore - image showing how to create sample item

5. Inside the Text field for "from-brazil", add the Brazilian flag image.

Sitecore - image showing how to create a page and insert a flag

6. Add "VISITORS FROM OTHER COUNTRIES" into the Text field for the "default" item.

Sitecore - image showing how to create a page and insert text

7. Save, submit and publish both items.

8. Load Home in Experience Editor.

9. Select the Sample Rendering on the page and click on the personalization button.

Sitecore - image showing how to access the personalization panel

10. Click on the Content dropdown selector (see red arrpw below) and set it to the "default" item we've created in step 4.

Sitecore - image showing how to add a item to a rule in the personalization panel

11. Click on the large plus signal at the top right, name the item "From Brazil" and click on the content selector to pick the "from-brazil" item.

Sitecore - image showing how to create a rule using country Geo IP

12. Click on the "Edit rule" button.

13. Search for "country". Select the country rule and set it as "where the country is equal to Brazil"

Sitecore - image showing how to add details to the GEO IP rule

14. Now, return to the page in the Experience Editor. Try selecting each of the two variations by clicking on the arrows, doing so should allow you to view the result of each variation. Save the page.

Sitecore - image showing how to switch between the personalization items

15.To verify that the personalization works, you can open the Explore tool. 

Sitecore - image showing how to switch between the personalization items

16. On the left-hand side, at middle of the page, click on the white arrow to show the Settings panel. Click on Visitor Information -> GEO IP. Click on Country. Using the dropdown, select Brazil and click on the Apply button. In this case, you can see that the version with the Brazilian flag is displayed. If you select any other country, the flag should disappear.

Sitecore - image showing the Brazilian flag when visitor comes from Brazil

In order to view this personalization working live on your website, you need to invest in the Sitecore IP Geolocation service. The test above is simply a way to verify that content and rules are working in concert.

Need more background on SItecore IP Geolocation? Read our recent article on the challenges and benefits of Sitecore IP Geolocation

comments powered by Disqus