The XGeo add-on, gives you the ability of directly collecting user location data with all the received requests.
The XGeo add-on, gives you the ability of directly collecting user location data with all the received requests.
This add-on works by performing a lookup with the IP address of the user.
It won't provide you with the home address of your website visitors, but it will give you a valuable insight.
Once you enable this addon, all the requests coming from your website will contain the following X-Headers with the corresponding accuracy levels:
And an additional header containing the IP address:
You can start making use of xGeo addon in three simple steps:
1. Activate the add-on on sprtags.io Containers -> Add-ons -> xGeo and click on save:
2. Test the setup by sending a request to the server side container:
This can be done by just opening your web container on preview mode, or by using curl.
To use curl: Click on the three dots at the top right of the screen:
To execute the command follow the instructions below, paste it, and press enter (↵.):
Windows:
Open Command Prompt or PowerShell on your Windows machine. You can find Command Prompt in the Start menu, or use the Windows key + R to open the Run dialog box and type cmd.
Mac:
Open Terminal by using the Spotlight search or by pressing Command (⌘) + Option + T on your keyboard.
If we inspect the incoming HTTP request, we should be able to see the X GEO headers with the location information.
You can see that the location was detected successfully and that the new headers are available.
3. Use the provided header names to create the corresponding header variables inside the server side container:
- Click on Variables.
- In User-Defined Variables click on new.
- Select Request Header as variable type.
- Enter the header name in the name field.
- Give the Variable a name and click save.
If we reopen the preview mode and repeat the tests, the variables with the header values will be showing:
Now, you are ready to start sending the location data with your tags.