title: Tracking AJAX-based forms with Google Analytics Goals
body: <p>I'm developing sites using a content management system, features are added via 3rd party modules which is much easier for designers like myself. However, I'm a bit perplexed at the moment.</p>
  
  <p>I have an AJAX-based contact form, so there is no page-load upon submission. However, I do have access to HTML templates for each step (Input page, Form submitted, and the email that is sent).</p>
  
  <p>I did some research on the GA.js library and it seems like I'd want to use the _trackPageView function. I cobbled some code together based upon threads in the GA Help group, but I've been monitoring the account for 2days now (while submitting test forms ~5+ times per day) but I am not seeing the goal being completed, nor am I seeing the 'dummy page' show up under my Top Content list (fully expanded). The code I'm using is the following:</p>
  
  <pre><code>/script tag/
  
      try {
          var pageTracker = _gat._getTracker("UA-#####-##");
          pageTracker._trackPageview(/formcomplete.html);
      } 
      catch(err) {}
  /close script/
  </code></pre>
  
  <p>The goal URI is setup as Head Match and uses the value /formcomplete.html  it is active, and the site is tracking. Any thoughts?</p>