How do you troubleshot google analytics code?

Viewed 1219

Can anyone share best practices for troubleshooting google anlytics code?

Has anyone built a debugging tool? Does google have a linter hidden somewhere? Does anybody have a good triage logic diagram?

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.

The workflow looks like this:

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.

For obvious reasons, I'm not satisfied with this workflow and hoping someone has figured out something I haven't.

3 Answers
Related