Update time: August 1, 2023
This article introduces how to obtain IP and geographic location through third-party API, In fact, geographic information in Adobe Analytics does the same.
The basic idea is: when the page is opened, first query the third-party API to obtain IP and geographic information, then write it into the cookie, and then execute other rules to send the cookie information to Adobe Analytics.
I use https://ipinfo.io/ here, you can open this URL, you can see the information you can get:
All fields are available.
Here I use the ip and city fields, the code is as follows:
Note: Set the order to smaller data to ensure faster execution.
Then I published a test and saw that our ip and city were written into the cookie:
The next step is to read the cookie into the data element, and then send it to Adobe Analytics using eVars. Go and try it! !!