Google Analytics and Forms 2.0

Anonymous
Not applicable

Google Analytics and Forms 2.0

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>
Tags (1)
3 REPLIES 3
Kenny_Elkington
Marketo Employee

Re: Google Analytics and Forms 2.0

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.
Anonymous
Not applicable

Re: Google Analytics and Forms 2.0

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?
Anonymous
Not applicable

Re: Google Analytics and Forms 2.0

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.