SOLVED

Capture IP, Device and OS or Browser in forms?

Go to solution
Anonymous
Not applicable

Hi guys,

I want to capture the IP, Device, OS and Browser used by each filed out form. Is this possible with Marketo?

Thank you!

Tags (1)
1 ACCEPTED SOLUTION
SanfordWhiteman
Level 10 - Community Moderator

You would need to re-supply this information from the client side. The IP address you can get using an API like the WhatIsMyIP API (you can't get that solely in the browser, you must call out to an outside service to determine your public IP address). The OS, device, and browser can all be parsed out of window.navigator.userAgent.

View solution in original post

13 REPLIES 13
Zach_Rogers2
Level 2

Hi Raul,

This doesn't technically solve your problem for "capturing" but just in case you didn't know, you can Add Constraint on any "Filled Out Form" filter for Browser, IP Address, and Referrer, so you can make a couple different Smart Lists for anyone with Chrome, Safari, Firefox, etc., and then have a list of those people, in case that helps any.

SanfordWhiteman
Level 10 - Community Moderator

All of these properties are already associated with every Filled Out Form activity. Where else do you want to see them.. that's the question.

Anonymous
Not applicable

Hi Sanford,

I want to store them in custom fields for the GDPR, so if we are asked about the Double opt-in, we can show also from what IP, device, location they opted in.

Also would be nice to capture this from the Clicked Link activity.

Dan_Stevens_
Level 10 - Champion Alumni

Here are some additional attributes you might want to capture each time someone opts-in - for GDPR auditing purposes:

pastedImage_0.png

Anonymous
Not applicable

Hi Dan,

What value will give you capturing the Program Name and Program ID?

And why you are not capturing the IP or location and the Device used when double opted-in?

Thanks in advance!

Dan_Stevens_
Level 10 - Champion Alumni

We haven't figured out a way to incorporate these data points into custom fields of the lead record.  For now, we're just relying on the data that's included in the activity log:

pastedImage_0.png

As for the program name/ID, we have a central opt-in trigger campaign that listens for any opt-ins on any form:

First - as part of the content program that hosts the form, we capture the program data here (using the program tokens):

pastedImage_2.png

Which then gets transferred here:

pastedImage_1.png

SanfordWhiteman
Level 10 - Community Moderator

You would need to re-supply this information from the client side. The IP address you can get using an API like the WhatIsMyIP API (you can't get that solely in the browser, you must call out to an outside service to determine your public IP address). The OS, device, and browser can all be parsed out of window.navigator.userAgent.

Dan_Stevens_
Level 10 - Champion Alumni

Sandy, couldn't you also use a CDV flow step - with a trigger.client ip address token - for the "fills out form" smart campaign?:

pastedImage_0.png

Anonymous
Not applicable

Hi Sanford,

How can I set php values to a hidden field in the form please?

SanfordWhiteman
Level 10 - Community Moderator

MktoForms2.whenReady(function(form){

  form.addHiddenFields(

  <?php

    echo json_encode([

        "ipAddress" => $_SERVER["REMOTE_ADDR"]

      ]);

  ?>

);

});

You might be tempted to echo PHP variables directly into a JS block (and so have I, admittedly) but secure coding practices require that you prevent the output from containing runnable code, which writing and reading from JSON will accomplish.

Anonymous
Not applicable

Hi Sanford,

I use a Landing Page Template and inside a form section. For the solution you gave me, I'll have to use the embedded form feature or is there a way to use this without embedding the form into the landing page?

SanfordWhiteman
Level 10 - Community Moderator

You can't execute PHP from a Marketo LP.  Since you asked about PHP in particular, I assumed that meant on a third-party site.

Anonymous
Not applicable

Sorry my bad, then, it is possible to get this information on a normal form set on a landing page template?