This forum is no longer open and is for reading/searching only.
Please use our new MachForm Community Forum instead.
MachForm Community Forums » MachForm 2
Adding Google Analytics tracking code to form
Started 16 years ago by Regardt | 7 posts |
-
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 16 years ago # -
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.MachForm Founder
Posted 16 years ago # -
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 16 years ago # -
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 16 years ago # -
Yes, this code will track all your forms. Each of them with its own id number.
MachForm Founder
Posted 16 years ago # -
Hello! I was hoping to confirm the set up of Google Analytics in 3.5. I found the includes/view-functions.php file, and in the code, 4 instances of the <head> tag. Should I add the path to my GA code in each instance? ie, <script type="text/javascript" src="../js/google-analytics.js"></script>?
Thanks! Amy
Posted 10 years ago # -
Yes, you should add the path to all head instances.
MachForm Founder
Posted 10 years ago #
Reply
You must log in to post.