AnsweredAssumed Answered

Google Analytics Pageview Form OnSubmit

Question asked by 5b8e55335f537af59b2affe724d23884da382c8e on Aug 31, 2015
Latest reply on Aug 31, 2015 by Sanford Whiteman

Hi everyone,


I have configured my marketo forms to bring users directly to a pdf when they submit the form.  Doing so has caused my google analytics goal tracking not to work because it reliese on a page being loaded with "thank-you" in the url which no longer happens.


So I wrote some Javascript to trigger a false pageview in GA that would cause the goal to trigger but I dont see this showing up at all in GA and I don't get any javascript errors when completing the form:


  <script type="text/javascript">

     MktoForms2.whenReady(function (form){

      //Add an onSuccess handler

   form.onSuccess(function() {

        //fire off thank you page goal in analytics

        ga('send', 'pageview', '/marketo-thank-you');



        //Trigger adwords conversion




        // Take the lead to a different page on successful submit, ignoring the form's configured followUpUrl

        location.href = "https://{{my.GBL Link To Asset}}";

        // Return false to prevent the submission handler continuing with its own processing

        return false;






Any ideas as to why this is happening here is a sample page with the code on it: Content Delivery Network (CDN) and Cloud Computing Services Provider | Akamai