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!
Solved! Go to Solution.
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.
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.
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.
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.
Hi Sanford,
How can I set php values to a hidden field in the form please?
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.
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?
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.
Sorry my bad, then, it is possible to get this information on a normal form set on a landing page template?
Sandy, couldn't you also use a CDV flow step - with a trigger.client ip address token - for the "fills out form" smart campaign?: