Forums

[Plugin: Contact Form 7] Google Analytics to track all filled fields (ecommerce) (4 posts)

  1. Zygfryd Matuszewski
    Member
    Posted 9 months ago #

    I wonder how to implement GA to the form for tracking all datas from input and select fields filled by the user.

    It's simple to track goals like: on_sent_ok: "pageTracker._trackPageview('/thank-you.html');"
    but what when I want to track form with filled datas?

    When having ecommerce website you are allowed to track datas as a transaction.

    Tracking errors would also be helpful (eg. someone put 'blabla' instead of email address)...

    Any ideas?

  2. Zygfryd Matuszewski
    Member
    Posted 9 months ago #

    After submiting a form I would love to have something like:

    <script type="text/javascript">
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-XXXXX-X']);
    _gaq.push(['_trackPageview']);
    _gaq.push(['_addTrans',
    '1234', // ID zamówienia - wymagane
    'Acme Clothing', // nazwa sklepu
    '11.99', // razem - wymagane
    '1.29', // podatek
    '5', // wysyłka
    'San Jose', // miasto
    'California', // region
    'USA' // pańsywo
    ]);

    _gaq.push(['_addItem',
    '1234', // ID zamówienia - wymagane
    'DD44', // jednostka magayznowa-kod - wzmagane
    'T-Shirt', // nazwa produktu
    'Green Medium', // kategoria lub odmiana
    '11.99', // cena jednostkowa - wymagane
    '1' // ilość - wymagane
    ]);
    _gaq.push(['_trackTrans']);
    (function() {
    var ga = document.createElement('script'); ga.type =
    'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ?
    'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(ga, s);
    })();
    </script>

  3. krmmalik
    Member
    Posted 6 months ago #

    Did you have any luck with this?

    I want to do dynamic tracking of my filled in forms too, and i have tried variations of the gaq.push code with no luck.

    I'd be grateful for any response

  4. Zygfryd Matuszewski
    Member
    Posted 6 months ago #

    Hi
    I tried this then but I have no clue how to do it so I dropped.

    If you find some solution share it please!

Reply

You must log in to post.

About this Topic