<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Gravity Support Forums Topic: Onclick Google Event Tracking</title>
		<link>https://legacy.forums.gravityhelp.com/topic/onclick-google-event-tracking</link>
		<description>Gravity Support Forums Topic: Onclick Google Event Tracking</description>
		<language>en-US</language>
		<pubDate>Tue, 21 Apr 2026 08:28:07 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>https://legacy.forums.gravityhelp.com/search.php</link>
		</textInput>
		<atom:link href="https://legacy.forums.gravityhelp.com/rss/topic/onclick-google-event-tracking" rel="self" type="application/rss+xml" />

		<item>
			<title>dtche1 on "Onclick Google Event Tracking"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/onclick-google-event-tracking#post-302506</link>
			<pubDate>Tue, 04 Jun 2013 23:24:31 +0000</pubDate>
			<dc:creator>dtche1</dc:creator>
			<guid isPermaLink="false">302506@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;@askena - thanks for the tip on disabling the auto format. I am going to give that a try.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>btrilli on "Onclick Google Event Tracking"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/onclick-google-event-tracking#post-301632</link>
			<pubDate>Tue, 04 Jun 2013 13:43:10 +0000</pubDate>
			<dc:creator>btrilli</dc:creator>
			<guid isPermaLink="false">301632@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I am using the same approach as caconroy1 I am adding the following code to the function.php file.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_action(&#38;quot;gform_after_submission&#38;quot;, &#38;quot;gf_ga_tracking&#38;quot;, 10, 2);
function gf_ga_tracking($entry, $form) {
    ?&#38;gt;
    &#38;lt;script type=&#38;quot;text/javascript&#38;quot;&#38;gt;
	jQuery(document).ready(function($) {
            _gaq.push([&#38;#39;_trackEvent&#38;#39;, &#38;#39;Forms&#38;#39;, &#38;#39;Submission&#38;#39;, &#38;#39;&#38;lt;?php echo $form[&#38;quot;title&#38;quot;]; ?&#38;gt;&#38;#39;]);
	});
    &#38;lt;/script&#38;gt;

&#38;lt;?php }&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;but I am receiving a  ReferenceError: jQuery is not defined @ &#60;a href=&#34;http://domain.com/request-service/#gf_5:3&#34; rel=&#34;nofollow&#34;&#62;http://domain.com/request-service/#gf_5:3&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;I know I have to have jQuery added to the page. But I figured it was taken care of by another plugin. from this code on my page:&#60;/p&#62;
&#60;p&#62;&#60;code&#62;&#38;lt;script type=&#38;#39;text/javascript&#38;#39; src=&#38;#39;http://culliganwaterdeals.com/wp-content/plugins/wp-lightbox/js/jquery.min.js?ver=1.7.1&#38;#39;&#38;gt;&#38;lt;/script&#38;gt;&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;If now what is the best way to add jquery to my site?&#60;/p&#62;
&#60;p&#62;Thanks&#60;br /&#62;
Greg
&#60;/p&#62;</description>
		</item>
		<item>
			<title>asenka on "Onclick Google Event Tracking"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/onclick-google-event-tracking#post-241502</link>
			<pubDate>Tue, 07 May 2013 14:37:56 +0000</pubDate>
			<dc:creator>asenka</dc:creator>
			<guid isPermaLink="false">241502@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I wasn't able to inject my on click even in the submit button, but I was able to get my script to work in the confirmation message. Using this tracking method has helped me track when the form has been successfully submitted instead of just tracking the submit button clicks which track all clicks (even if the user made errors on the form and the form was not successfully submitted.&#60;/p&#62;
&#60;p&#62;&#60;code&#62;&#38;lt;script&#38;gt;_gaq.push([&#38;#39;_trackEvent&#38;#39;, &#38;#39;Forms&#38;#39;, &#38;#39;Submit&#38;#39;, &#38;#39;NameOfForm&#38;#39;]);&#38;lt;/script&#38;gt;&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;Sometimes the confirmation message removed my script tags, but  checking the Disable auto-formatting option fixed that issue. I hope this helps.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>amadex on "Onclick Google Event Tracking"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/onclick-google-event-tracking#post-222506</link>
			<pubDate>Wed, 24 Apr 2013 10:45:31 +0000</pubDate>
			<dc:creator>amadex</dc:creator>
			<guid isPermaLink="false">222506@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;This Google Analytics tracking issue is something that I also agree should be an integrated functionality and not something that we should try to make work for ourselves... This is basic...&#60;/p&#62;
&#60;p&#62;The methods are also archaic. Pasting the tracking code in the confirmation message is something that shouldn't happen, because it makes code maintenance a nightmare.&#60;/p&#62;
&#60;p&#62;I could never make it work through functions.php also (ajax confirmation message), neither with gform_after_submission nor gform_confirmation...
&#60;/p&#62;</description>
		</item>
		<item>
			<title>caconroy1 on "Onclick Google Event Tracking"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/onclick-google-event-tracking#post-222499</link>
			<pubDate>Wed, 24 Apr 2013 10:39:27 +0000</pubDate>
			<dc:creator>caconroy1</dc:creator>
			<guid isPermaLink="false">222499@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I have to admit I'm pretty frustrated with this - I've seen multiple topics dedicate to this issue and the support always seems to involve editing the functions.php or other code-level work which isn't a reasonable thing to expect of your customers.&#60;br /&#62;
Will Gravity Forms be adding this functionality to a release any time soon?  Because right now this issue and the lack of support is making me question whether purchasing this was a good idea.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>amadex on "Onclick Google Event Tracking"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/onclick-google-event-tracking#post-221264</link>
			<pubDate>Tue, 23 Apr 2013 17:06:58 +0000</pubDate>
			<dc:creator>amadex</dc:creator>
			<guid isPermaLink="false">221264@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Did anybody found a solution for google analytics tracking with ajax forms?!... I don't understand why it works when pasting the script _gaq code in the confirmation message (ajax) but not injecting the same script trough gform_after_submission action!...
&#60;/p&#62;</description>
		</item>
		<item>
			<title>caconroy1 on "Onclick Google Event Tracking"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/onclick-google-event-tracking#post-205608</link>
			<pubDate>Thu, 11 Apr 2013 10:17:12 +0000</pubDate>
			<dc:creator>caconroy1</dc:creator>
			<guid isPermaLink="false">205608@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;You bet, so here is the functions.php: &#60;a href=&#34;http://pastebin.com/geF7putG&#34; rel=&#34;nofollow&#34;&#62;http://pastebin.com/geF7putG&#60;/a&#62;&#60;br /&#62;
and here is the code I was trying to add: &#60;a href=&#34;http://pastebin.com/8ULkEpjL&#34; rel=&#34;nofollow&#34;&#62;http://pastebin.com/8ULkEpjL&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Keep in mind this is a child theme but the parent theme's php should not be edited.&#60;br /&#62;
I also tried the onclick event tracking code in the footer, where my GA code lives.  But that simply tracked everyone who viewed, rather than clicked.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Onclick Google Event Tracking"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/onclick-google-event-tracking#post-201319</link>
			<pubDate>Mon, 08 Apr 2013 13:37:22 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">201319@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;If you have a parse syntax error, you pasted the code in a bad place, or the code was invalid. Can you show us the code you were trying to paste, or post your complete functions.php and (separately) the code you want to add to pastebin.com or pastie.org?  We can help you with the placement so you can try that solution.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>caconroy1 on "Onclick Google Event Tracking"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/onclick-google-event-tracking#post-195747</link>
			<pubDate>Wed, 03 Apr 2013 17:06:45 +0000</pubDate>
			<dc:creator>caconroy1</dc:creator>
			<guid isPermaLink="false">195747@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hello,&#60;br /&#62;
I've checked a number of the other forum topics on this but haven't been able to find an answer for my question.  I'm trying to add onclick event tracking for Google analytics and when I edited the function.php of my site it threw a parse syntax error.&#60;br /&#62;
Because my theme includes a specific html header/footer area, that is where the Google Analytics code lives, so I tried adding the event tracking code to the same area.  That simply tracked everyone who saw the button, rather than just those who actually clicked the button.&#60;br /&#62;
I've spent a number of hours trying to figure out how to add this code to the button on a Gravity form, is there something I'm missing?   Where can I edit the code related to the submit button?  The form I'm referring to lives in the footer of every page: &#60;a href=&#34;http://www.conroymediagroup.com/&#34; rel=&#34;nofollow&#34;&#62;http://www.conroymediagroup.com/&#60;/a&#62;.&#60;br /&#62;
Thanks,&#60;br /&#62;
Cate
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
