Skip to main content
May 18, 2015
Question

Device type used when a lead submits their email

  • May 18, 2015
  • 1 reply
  • 1577 views

Does Marketo automatically track which device type was used when a lead submits their email using a Marketo form (ex. desktop, tablet, mobile).?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

Casey_Grimes2
Level 10
May 19, 2015

Hi Courtney,

By default, Marketo does not track what type of device was used to submit form, but you can track this with a little extra work. Now, there's dozens of ways to solve this potential problem, but I'm going to assume you don't want to track the size of the screen, or track what type of device is being used (say, an iPad vs. iPhone vs. Android vs. Blackberry), but simply "what device was used to fill out this form." Create a string field (in this case, I'm calling it userAgent) to store the value. Add this field as a hidden field for your form, and embed the following script somewhere on your landing page:

<script src="https://cdnjs.cloudflare.com/ajax/libs/mobile-detect/1.1.0/mobile-detect.js"></script>

<script>

    var md = new MobileDetect(window.navigator.userAgent);

    phone = md.mobile();       

    tablet = md.tablet();

   

    if (phone) {

        var ua = "Phone";

        }

   

    if (tablet) {

        var ua = "Tablet";

        }

   

    if (phone == null && tablet == null) {

        var ua = "Computer";

        }

</script>

Then, when embedding your form, you would simply alter your embed to look like

MktoForms2.loadForm("//app-whatever.marketo.com", "123-ABC-456", 1234, function (form){

form.vals({"userAgent":ua});

  });