How to get userip and useragent from API connector?

Glassdoor asks for the user’s IP and browser information in every API call. How do we get and then pass that information?

https://www.glassdoor.com/developer/index.htm

User agent:

Install js Toolbox if you don’t have it already. Go to plugins tab and search “toolbox”

In the design editor you’ll have a Javascript to Bubble element. Drag one onto the page you want to capture the user agent. Set the dimension 1x1 pix
In the appearance settings, “bubble_fn_suffix” enter “ua” (without quotes)
Click the Publish value checkbox, value type text.

Go to Workflow tab. On page load —> Plugins —> Run javascript
In the box put this:

var ua_result = navigator.userAgent;
	bubble_fn_ua(ua_result);  
console.log (ua_result);

On the design editor, drag an input element and set the pix 1 x 1; no border.
Remove placeholder value. Set “initial content” to JavascripttoBubble A’s value.
This inputs value now contains the user agent.

For IP try searching plugin “ipiphy”

Hope this helps.

3 Likes

Thanks for helping me out @elledarrow. The IP address is being captured but the User Agent isn’t.

I’ve added the workflow and elements on the sign-up page and created a new Data type “Agent Details”.

Screenshot (244) Screenshot (243)

What needs to be corrected ?

1 Like

@sharma.himanshu0608
Try creating the new Agent details on a button click instead of on page load. Surely there is a necessary button click - search, display, etc. that is clicked before you need to send the details… try creating the entry on that button click.

Did that as well but the user agent is still not getting captured. The field type for saving the user agent should be in text right ?

add the css tools plugin gives useragent CSS Tools Plugin | Bubble
vvv

2 Likes

I made a sample… Hope this explains.


@sharma.himanshu0608

1 Like

Thanks @elledarrow and @Bubbleboy for the tips. It’s working now :grinning:

1 Like

Hi @Bubbleboy, @sharma.himanshu0608 and @elledarrow.

Thank you guys for helping on the forum with lots of help. Many plugins have documentation that are not helpful at all. I have tried your hints and I still have problems with User Agent on when I view my app on browser preview. I have done the following just as you did on here:



And please @Bubbleboy what part of the css tools plugin took you to this settings…I couldn’t get myself there:

It’s been frustrating and I thank you guys for coming to the rescue!