title: Targeting window.location.pathname
body: <p>I have a url similiar to this:</p>
  
  <pre><code>www.mysite.com/products/
  </code></pre>
  
  <p>I was using this to test against the pathname:</p>
  
  <pre><code>if (/\/products\//.test(window.location)) {
  _gaq.push(['_trackPageview', '/products/landing']);
  }
  </code></pre>
  
  <p>But the problem I was running into was the above would execute for sub-folders as well, which I do not want:</p>
  
  <pre><code>www.mysite.com/products/sub-folder/
  </code></pre>
  
  <p>I'm thinking window.location.pathname will help me out more than the above jQuery. But I'm unsure how to target only the top-level directory, and not the sub directories within it?</p>