title: How do you troubleshot google analytics code?
body: <p>Can anyone share best practices for troubleshooting google anlytics code?</p>
  
  <p>Has anyone built a debugging tool?  Does google have a linter hidden somewhere? Does anybody have a good triage logic diagram?  </p>
  
  <p>I'll periodically set up different parts of GA and it seems like every time I do it takes 4 or 5 days to get it working.</p>
  
  <p>The workflow looks like this:</p>
  
  <pre><code>Read the docs on the feature (e.g. events, custom variables).
  Implement what appears to be the correct code based on the docs.
  Wait a day.
  See no data.
  Google every version of the problem I can imagine.  Find what may be a solution.
  Change my code.
  Wait a day.
  See no data.
  Loop:
      Randomly move elements of the tracking code around.
      Wait a day.
      If other parts break, tell ceo, get yelled at, revert changes.
      If data appears, break.
  Pray it continues to work/I never have to change the tracking code again.
  </code></pre>
  
  <p>For obvious reasons, I'm not satisfied with this workflow and hoping someone has figured out something I haven't.  </p>