SOLVED

Re: Capture IP, Device and OS or Browser in forms?

Go to solution
Anonymous
Not applicable

Capture IP, Device and OS or Browser in forms?

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

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Capture IP, Device and OS or Browser in forms?

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
SanfordWhiteman
Level 10 - Community Moderator

Re: Capture IP, Device and OS or Browser in forms?

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

Re: Capture IP, Device and OS or Browser in forms?

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.

SanfordWhiteman
Level 10 - Community Moderator

Re: Capture IP, Device and OS or Browser in forms?

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.

Anonymous
Not applicable

Re: Capture IP, Device and OS or Browser in forms?

Hi Sanford,

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

SanfordWhiteman
Level 10 - Community Moderator

Re: Capture IP, Device and OS or Browser in forms?

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

Re: Capture IP, Device and OS or Browser in forms?

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

Re: Capture IP, Device and OS or Browser in forms?

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

Re: Capture IP, Device and OS or Browser in forms?

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

Dan_Stevens_
Level 10 - Champion Alumni

Re: Capture IP, Device and OS or Browser in forms?

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