Appnitro Software Forums » MachForm

Adding Google Analytics tracking code to form

(5 posts)

  1. Hi,

    How do i, insert tracking text my form? I'm linking to this form from the website.

    Thanks

    I have seen the posts with regards but it's only applicable to iframes usage.

    Posted 3 years ago #
  2. Open your includes/view-functions.php file.

    Inside display_form() function, around line 1827-1833 you'll find this:

    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>{$form->name}</title>
    <link rel="stylesheet" type="text/css" href="{$css_dir}view.css" media="all" />
    <script type="text/javascript" src="js/view.js"></script>
    {$calendar_js}
    </head>


    Simply insert your tracking code between those head tags.

    Posted 3 years ago #
  3. philwareham
    Member

    Hi,
    Google seem to want their analytics code placed just before the body close tag (though I guess it make no difference really), so you could place the tracking code between lines 1854 and 1855 of includes/view-functions.php if you wish.

    Posted 3 years ago #
  4. Hi, Thanks for the quick response.

    Question: how will this code know which form to to track. I have 20 forms and only 1 needs this code?

    Posted 3 years ago #
  5. Yes, this code will track all your forms. Each of them with its own id number.

    Posted 3 years ago #

RSS feed for this topic

Reply

You must log in to post.