This tutorial will show you how to record the IP details and user agent in Bubble.io for APIs
Many times, when you want to integrate some API with Bubble.io, the API will require the IP address and the user’s agent in the parameters. Glassdoor is one example.
The user agent contains information like the browser and the OS of the device used to access the site. You’ll need to pass this information and it makes sense to store this information someplace.
You can also use this information for yourself to see from which region you get the maximum traffic and whether the user is using a laptop or mobile.
Install the plugins
First, install two plugins.
- Platform information by Airdev — Link
- Ipiphy by Bubble
Both these plugins are in the plugin tab and once you’ve installed them, half of the work is done.
Set up the plugins
It’s better to create a new Data Type with two fields — IP address and User Agent. Both of text type with one additional field of User of User type.
Drag and drop the Platform information element on whichever page you want to capture the agent details.
Saving the information
To save the IP address, say upon login/sign up, create a new thing in these workflows of type of User Agent.
For IP address, choose “Get data from External API and then select Ipiphy as the API provider.
Make sure that the Platform information element is there on the page where you’re setting up this workflow.
Now everything is ready and you can test if it is working properly or not.
If you’re still stuck somewhere, hit me up on Twitter or send me an email at email@example.com.