View Full Version : Analytics Code for AdSense Breaking Theme

09-27-2011, 02:16 PM
I'm trying to add the Google Analytics code, not the standard Analytics code, but the code that lets you connect your AdSense account to your Analytics account and it's breaking the theme.

It was working fine with my other theme, but for some reason, Socrates doesn't seem to like it. I'm adding the code in manually using DreamWeaver. I even tried adding random text instead of the Analytics code and the theme looked perfect, but as soon as I put the Analytics code into the template, it looked messed up again.

If I hadn't already been using the code with another theme, I would think it was the code, but that doesn't seem to be the case.

Dan Nickerson
09-27-2011, 02:41 PM
Always include a link and clarify what you mean about using Dreamweaver?

Is there a reason you're not using our analytics box on Socrates > Layout?

The only way it would be breaking the theme is if you are missing a closing tag in your analytics code. Not having the closing </script> tag can cause problems.

09-28-2011, 06:25 AM
Actually, I am using the Analytics box on Socrates, but I was under the impression that's only for the regular Analytics code, the one that goes directly before the closing Head tag.

I'm talking about the pieces of Analytics code that connect Analytics to Adsense. There are 2 pieces of code for this. One goes at the very top of the page, before any other code, so at the very top of the header.php and the second piece goes right before the closing Body tag in the footer.php.

Since I'm a web designer, I prefer to make the changes manually in DreamWeaver, instead of using the code editor in Wordpress. I probably won't share the link, because since it's an active AdSense site, I can't afford to leave the error up that long.

I'll double check and see if any pieces of code might be missing.