Google Analytics and Forms 2.0 | Community
Skip to main content
March 6, 2014
Question

Google Analytics and Forms 2.0

  • March 6, 2014
  • 3 replies
  • 1767 views
Hey all,

With forms 1.0, we had included some HTML on our landing pages that would basically create an event in GA, which we customized to help track downloads of different types of assets. We recently implemented Forms 2.0, but it seems we no longer have any of the GA tracking when someone submits. Has anybody found a way to do something similar? Here's an example of the script:

<script>
  var $jQ = jQuery.noConflict();
     // Use jQuery via $jQ(...)
     $jQ(window).load(function(){
         $jQ("#mktFrmSubmit").wrap("<div class='buttonSubmit'></div>");
         $jQ(".buttonSubmit").prepend("<span></span>");
         var oldFormSubmit = formSubmit;
         window['formSubmit'] = function(elt){
          _gaq.push(['_trackEvent', 'offer-video', 'watched', 'social-Dashboards-Demo']);
          return oldFormSubmit(elt);
         }
     });
       
</script>
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

3 replies

Kenny_Elkington
Adobe Employee
Adobe Employee
March 7, 2014
Hey Trask,

Check out the Forms 2.0 API here: http://developers.marketo.com/documentation/websites/forms-2-0/  You should just be able to add your Google Analytics event to the onSubmit method as a callback.
June 24, 2014
Hi, Were you able to come to a resolution. I'm looking to the same thing here:

We are trying to get google analytics events to fire upon form submission. The approach we took was customizing code from the form 2.0 embed code. By taking this approach we are not able to pick up any return visitor recognition or progressive profiling on the pages we placed the code (a marketo landing page or not). Does anyone have any recommendations on how we can get Google Analytic Tracking in our Marketo Forms, and maintain visitor recognition and progressive profiling capabilities?
March 17, 2015
I am just wanting to fire an event to GA on the submission of a form. What is the best way to do this?
If possible i would like to use Google Tag Manager to do it.