GTM or Analytics for JotForm tracking

  • perfectpitchdeck
    Asked on April 21, 2019 at 11:07 AM

    Hello.

    I use the GTM. And I have a problem with form submission tracking. GTM can't see form submission. Can you help with it?

    Jotform Thread 1799380 Screenshot
  • Kiran Support Team Lead
    Replied on April 21, 2019 at 11:35 AM

    Unfortunately, Google Tag Manager integration is not available with JotForm. Since there are scripts from Google Tag Manager that you need to add in the source to be able to track the conversion, you may try using your the full source code of the form to implement the Google Tag Manager.  Please note that the full source code embed may not work with WordPress website since it may cause conflicts with other scripts on the web page.

    Thanks!


  • perfectpitchdeck
    Replied on April 21, 2019 at 12:54 PM

     

    Thank you for fast response Kiran.

     

    But now I have more questions than it was:

     

    1. I don't have "Source code" in my publish settings. You gave me URL and there I see Source Code publishing menu. But in my JotForm this setting doesn't exist.

    1555865697JotForm Screenshot 10

    1555865741JotForm2 Screenshot 21

    2. Can I track form submissions by EventListener script, maybe you already have solutions?

  • Victoria_K
    Replied on April 21, 2019 at 2:24 PM

    I'm afraid, our form builder does not allow any script. 

    Apologies for missing this with first response, Full Source Code embed option is only available to forms with classic layout. Please consider converting your form: How-to-Change-the-Form-Layout

  • perfectpitchdeck
    Replied on April 21, 2019 at 8:27 PM

    Thank you for support. I appreciate it. But it is sad. I just can't get the forms to analytics. Forms on my site bring about the amount I need to submit to Analytics. As well as customer data. Tell me whether it is possible to customize the form so that it sends the data to the thankYou page (as in the attached image).
    1555892536JotForm3 Screenshot 10
    I need to transfer these form data to analytics, and I can’t believe that we cannot do this. Maybe you have thoughts on this.


    Kindest Regards

    Maksim.

  • Kiran Support Team Lead
    Replied on April 21, 2019 at 9:51 PM

    We have Google Analytics widget that might help you track the activities and behavior of visitors with your form and you might need to add JotForm submit URL to the exclusion list as mentioned in this thread

    Also, you may add the Google Analytics code to the custom Thank you page that is hosted on your web page.

    Please give it a try and let us know if you need any further assistance. We will be happy to help. 

  • perfectpitchdeck
    Replied on April 22, 2019 at 10:13 PM

    Thank you, JotForm team, for your support. If we cope with this task, then it can help many users of this service. I will try to describe everything in detail here.

    The challenge is to transfer the conversion value of a submitted form to Google Analytics.

    There are many JotForms on the site with a lot of steps and we cannot switch forms to the classic layout. In some of the forms, the conversion price depends on the parameters chosen and may be completely different. I need to take this value and transfer to Google analytics.

    1555985135JotForm3 Screenshot 10

    You can check this form in the test page:

    https://perfectpitchdeck.com/custom-decks-test-page/

    Maybe this setting can help me:
    1555985426JotForm4 Screenshot 21

    I turned it on. But I do not observe any data on the ThankYou page.

  • Jed_C
    Replied on April 22, 2019 at 10:55 PM

    I was reviewing Google Analytics here https://analytics.google.com and was not able to find a feature that does capture the value of a certain field. What I know it does is it captures the traffic, source of traffic, geographic location of the visitors etc.

    None of those mentioned about assigning a field that allows them to calculate the conversion for you.

    Your requirement needs a custom solution and Jotform's Google Analytics doesn't have that. You might need to consult for a developer and provide your current requirement, but again, you are currently using Card layout and custom solution might only work with form's source code which is with Jotform's classic form only.

    Regarding POST, that's a different thing, you can review our guide here https://www.jotform.com/help/213-Send-Submission-Data-via-Post-Method-and-Thank-You-Settings for more info.

  • perfectpitchdeck
    Replied on April 27, 2019 at 6:44 PM

    Solved!

    When I pasted in my form this URL:

    https://www.jotform.com/show-post-data/

    I got this:

    Data Submitted:

    Array

    (

        [submission_id] => 4321798550017985777

        [formID] => 99999999999

        [ip] => 111.**.***.111 

        [startby1] => Array

            (

                [0] => qwe

                [1] => qwe@asd.ro

                [2] => qwe

            )

     

        [whodo] => Array

            (

                [0] => Consultant|https://icons.jotfor.ms/cardforms/assets/icons/icon-sets-v2/color/Colored/jfc_icon_color-coloredjfsvg-business-color_board-30.png

            )

     

        [doyou] => david

        [howmany] => Array

            (

                [0] => 29

            )

     

        [estimatedcost7] => €3550

        [downpayment] => €1775

        [totalpayment] => €3550

        [promotioncode] => 12345

        [the50] => Array

            (

                [0] => ["Description (Amount: 1,775.00 EUR)"]

                [1] => EUR

                [2] => 1,775.00

                [3] => {"customerID":"cus_ExlqUa2FIgK6rM","chargeID":"ch_1ETqIvI3hTjj1qIppHoS2QAf","card":"","plan":"","setupFeeAmount":"","setupFeeDesc":"","subscriptionDelay":"","apiKey":"sk_test_9BnmUHWzuicWcZkcCallCs3F00Rqs6rhp8","paymentType":"donation","isCharged":"1"}

                [4] => cus_ExlqUa2FIgK6rM

                [5] => Test

                [6] => TEST

            )

     

    )

     

     

    PHP Code:

    $_POST['submission_id'];

    $_POST['formID'];

    $_POST['ip'];

    $_POST['startby1']['0'];$_POST['startby1']['1'];$_POST['startby1']['2'];

    $_POST['whodo']['0'];

    $_POST['doyou'];

    $_POST['howmany']['0'];

    $_POST['estimatedcost7'];

    $_POST['downpayment'];

    $_POST['totalpayment'];

    $_POST['promotioncode'];

    $_POST['the50']['0'];$_POST['the50']['1'];$_POST['the50']['2'];$_POST['the50']['3'];$_POST['the50']['4'];$_POST['the50']['5'];$_POST['the50']['6'];

    That was really helpful because I transact some of this data to my GTM dataLayer. I wrote a little PHP script which transacts e-commerce data and some of the custom dimensions to dataLayer.

    <?php

     

    $var = $_POST[totalpayment];

    $varid = $_POST['the50']['4'];

    $var = preg_replace("/\\€/", '', $var);

    $vardy = $_POST['doyou'];

    $varfid = $_POST['formID'];

    $varhm = $_POST['howmany']['0'];

    $varpm = $_POST['promotioncode'];

    $varsl = $_POST['howmany']['0'];

     

    echo "<script type='text/javascript'>

                   dataLayer.push({

      'ecommerce': {

        'purchase': {

          'actionField': {

            'id': '$varid',                         // Transaction ID. Required for purchases and refunds.

            'affiliation': 'Perfect Pitch Deck',

            'revenue': +'$var',                     // Total transaction value (incl. tax and shipping)

            'currencyCode': 'EUR',

            'tax':'0',

            'shipping': '0',

            'coupon': '$varpm'

            

          },

          'products': [{                            

            'name': 'Full Custom Form',     

            'id': '$varfid',

            'price': +'$var',

            'quantity': 1,

            'coupon': '$varpm',

            'consultant': '$vardy',

            'slides': '$varsl'                            

           }]

        }

      }

    });

                </script>";

    ?>


    This script was placed in 'Thank You' page. I turned on 'Send Post Data'. Also, 'Form Layout' => Single Question in One Page.

    Then transact dataLayer to Analytics via GTM. And now e-commerce data forms are displayed in Google Analytics.


     Thank you, Kiran, Victoria_K, and Jet_C. Your advice helped me advance with this matter. Perhaps this article will help someone and if I missed something then ask questions I will answer.