When Good Plugins Go Bad!

Except when it fails spectacularly!
Here’s the rub. The plugin has one big flaw. It gives you a fancy-pants front-end GUI to plugin in all sorts of options. One such option is to add in a custom _gaq.push statement. When you enter a “Custom Code” definition, the plugin automatically adds slashes before all quote marks before storing the setting in the database. It then removes them when it displays the plugin.

The problem is if you change another setting and save the changes A SECOND TIME, the plugin erroneously adds in another 2 slashes. When the plugin is executed it’s not able to strip out all of the slashes and thus causes a complete failure of the tracking code. Hence, there’s NO DATA FLOWING INTO ANALYTICS! NICE ONE!
Here’s a simple solution…
Stop using unneeded plugins. A plugin to include google analytics is extremely unneccessary given the easy nature of adding your tracking code manually. Here’s how you can do that:
- Grab the analytics code from Google Analytics.
- Add in your custom _gaq.push statement(s).
- Use the built-in template editor inside wordpress or login via your FTP server and navigate to: /<wordpress directory>/wp-content/themes/<your theme>/header.php
- Open header.php file
- Paste the entire code snippet from step 2 right before <?php wp_head(); ?>
- Give a sigh of relief in knowing you no longer need to fear a freak plugin blowing up and rendering your important tracking data useless or nonexistent!