Bobby
Bobby

Reputation: 1604

Best way to spoof geo ip information in xDB

I am looking to spoof the geo ip information in my local sitecore 8 instance so I can create events widget based on which city the end user is in.

From my research I found you can either use the ForwardedRequestHttpHeader in the header to pass the IP or my own class to override the IP via startTracking pipeline. Both these method allow me to write the IP address into the Interaction collection in my xDB.

My question is how do I resolve the spoofed IP to get rest of the details in Interaction collection document such as city, state, country and postcode?

Please note: I currently do not have access to the sitecore geolocation service. So really need a way to mock all the geo location based data.

Upvotes: 1

Views: 448

Answers (2)

Bobby
Bobby

Reputation: 1604

What I needed to was to spoof the IP address but also create a custom geo ip lookup provider by overriding the method GetInformationByIp(string ip) in LookupProviderBase.

Upvotes: 0

Brad Christie
Brad Christie

Reputation: 101614

Not sure if it helps, but 8.1's Experience Explorer allows you to (natively) spoof locations. If you expand out the ribbon and goto the Experience Tab and click "Other" you'll see "Explore":

Explore via Experience Tab

Once you click that, the UI will change over and expose two expandable tabs (on left and right). On the left slide-out, you can manage location by going to the "Visitor Information" section and opening the "GEO IP" tab.

GEO IP via Visitor Information

Upvotes: 1

Related Questions