Personalization with geo-based conditions does not work properly on the first visitor request

  • When using personalization or conditional renderings with rules based on the geographical information of the visitor (such as where the country is equal to specific country), the personalized content might not been presented to the visitor correctly on the first request.

    Such behavior occurs because Sitecore is designed not to wait until the GeoIP information has been resolved from a GeoIP lookup provider. This is implemented to keep response times for the website visitors low in situations when the GeoIP resolution process is taking a long time.

  • To make Sitecore wait for the GeoIP information even on the first request from a visitor, proceed as follows:
    1. Create a custom processor for the createVisits pipeline:
      namespace Sitecore.Support.Analytics.Pipelines.CreateVisits
      using Sitecore.Analytics.Pipelines.CreateVisits;
      using Sitecore.Configuration;
      using Sitecore.Diagnostics;
      using System;
      public class UpdateGeoIpData : CreateVisitProcessor
      public override void Process(CreateVisitArgs args)
      Assert.ArgumentNotNull(args, "args");
      Assert.ArgumentNotNull(args, "args");
      int intSetting = Settings.GetIntSetting("Analytics.PerformLookup.CreateVisitInterval", 5); // retrieve the delay value from the setting.
      args.Interaction.UpdateGeoIpData(TimeSpan.FromSeconds((double) intSetting)); // wait for the time specified in the Analytics.PerformLookup.CreateVisitInterval setting.
    2. Replace the <processor type="Sitecore.Analytics.Pipelines.CreateVisits.UpdateGeoIpData, Sitecore.Analytics" /> processor with the created one.
    The approach overrides the logic of the createVisit pipeline and makes Sitecore wait a certain period of time for the GeoIp information to be resolved. The delay time is configured using the Analytics.PerformLookup.CreateVisitInterval setting. The setting defines the maximum delay to resolve the geographical data from the lookup provider allowed during the first page-request of a new visit.
  • Implement a custom lookup provider to use a local GeoIP database instead of a web service.

    For example, you can use the GeoLite database (, which offers less accurate but faster resolving of the GeoIP information.

    To implement a custom lookup provider, please refer to the How to Implement a GeoIP Lookup Provider section of the following document: Engagement Analytics Configuration Reference.

    For specific implementation examples, check the related modules on

Applies to:

CMS 6.5+

March 05, 2014
November 15, 2019

Reference number:

396075, 94330


  • DMS,
  • xDB