Skip to main content
Collect User Browser Type with your Lead

Want to add the user browser type to your lead, then this article will guide you through it,

James Dodd avatar
Written by James Dodd
Updated over 2 years ago

PLEASE NOTE: Some sections of this guide require an understanding of HTML and JavaScript. If you require further assistance we can be commissioned to do this whole work for you!!

There are 3 steps to this guide... 1, adding a custom field, 2 adding the field to your landing page and 3 populating this field.

Add a custom field

First, in your campaign, create your custom field. It will need to be a string.

Head to Field Types

We need this field to be a hidden fields.

Head to your field definitions: Leads > Fields

Find your field here and then head to the Form Field area and ensure the type is set to hidden.

Add to landing page

Next we need to add these fields to our landing page. So head to the page and edit your form. Turn the fields on.

Next step is to synchronise HTML to insert the relevant fields into your form (this will insert fields between each fieldset tag).

Populate the field - add some custom JavaScript

The final step, is to add the following script to you JavaScript tab of the file (or site assets or site-layout).

Here' we're assuming your field is F_1120_BROWSER, yours will be different, so refer to your integration document which will give you the exact name:
​

var browserName = (function (agent) {switch (true) {
case agent.indexOf("edge") > -1: return "MS Edge";
case agent.indexOf("edg/") > -1: return "Edge ( chromium based)";
case agent.indexOf("opr") > -1 && !!window.opr: return "Opera";
case agent.indexOf("chrome") > -1 && !!window.chrome: return "Chrome";
case agent.indexOf("trident") > -1: return "MS IE";
case agent.indexOf("firefox") > -1: return "Mozilla Firefox";
case agent.indexOf("safari") > -1: return "Safari";
default: return "other";
}})(window.navigator.userAgent.toLowerCase());

$('input[name="F_1120_BROWSER"]').val(browserName).trigger('change');

Adding additional Information

If you want to add additional information to your string, you can update the following

eg: to add device platform replace:

$('input[name="F_1120_BROWSER"]').val(browserName).trigger('change');

With

var returnString = browserName + ' ' + window.navigator.platform;
$('input[name="F_1120_BROWSER"]').val(browserName).trigger('change');



Result:

The browser name should now be passed to your field.

Remember to test this thoroughly and ensure you're getting the results you need.
​


πŸš€ Need More assistance?

If you're stuck or if this isn't something you or your team is comfortable with, then please open a new chat/ticket (chat icon in the bottom right of the screen) or email support@databowl.com.

We're here to assist with any questions you have, and if required we can quote on actioning work like this for as part of our Marketing Services.

Did this answer your question?