Google Analytics Not Working from Custom CSS

4 posts in this topic

I had Google Analytics working on a site which I just completely redid using DMS.  I took the site live last Monday night and forgot to put in the tracking code for the first few days and then last Friday put it in (added to the Custom CSS box) and checked the source code for the home page and it was showing in there.


Today there is still no data showing up in Analytics for the past week including today and I contacted tech support for Analytics and the rep said the source code was not showing the Analytics tracking code.  I then realized that I was logged in and he was not so I logged out of WP and rechecked the source code for the page and when I checked it this time it was not showing up.


I checked further and noticed that I would insert the code into Custom CSS and then save it and Publish and when I logged out and back in it wouldn't be there but there would be something starting with 'Minify'.  My minify plugin was already deactivated so I deactivated my auto-optimize plugin and then the Analytics code would stay correct in the Custom CSS when I logged out and in again.  But even after this it still wouldn't show in page source code when I logged out.  I even cleared the cache to make sure that wasn't the issue but it didn't fix this problem.


I'm using DMS version 1.1.5 with the child theme version 1.0.1 and WP version 3.8.1.  The site is  Would love to get some help in sorting this out.  Analytics has people to help with getting the code working but I know from past experience that when the issue is theme-related it is better to get help from the theme people because either the Analytics people will say they can't help or they will suggest something that may cause other problems.


Any suggestions?




Share this post

Link to post
Share on other sites

Hi Ron


Looking at the source code currently it's showing a previously cached version by the plugin wp super cache, not the live site. If you clear the cache file inside the wp super cache plugin, then disable it completely. Then go back back and check the analytic code is in the header scripts box, not the custom css box. It needs to go into the header scripts box to be seen. Save, check the code is correct and present. Then go to google and check the code is showing as installed/tracking.

Share this post

Link to post
Share on other sites

Hii James,


Thanks for figuring that out.  For some reason I was so used to using the custom css box that I completely overlooked that there was a 'header scripts' box.  Kind of looking for your keys and you find out after 10 mins they've been in your hand all the time.


Did what you said exactly and it is now showing up and working.  Thanks so much!

Share this post

Link to post
Share on other sites

Thanks for informing us the issue has been resolved.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • Adding Google Analytics Event Tracking to Pagelines Button
      By dgsarnow+
      I would like to add Google Analytics click tracking to the buttons on my site. I use the Pagelines shortcodes for the buttons. I was able to add the necessary header script easily using Custom Scripts.
      How can I insert the following onclick option to my buttons?
      onclick=”trackOutboundLink(‘’); return false;"          
    • Google Analytics
      By atcdomainsolutions+
      When adding Google Analytics to a site, it's best to add it into the Custom Javascript/Header HTML area (below the Custom LESS box) to ensure it is tracked on all pages, correct?
      If not, where should I add it?  
    • Tracking Pixel Placement (Pagelines Customize Plugin Doesn't Work)
      By kboyle10
      I found this solution initially to this problem of placing tracking pixels on an individual page.
      However, the Pagelines Customize plug suggested does not work. I've already designed nearly my entire site with content and I don't know what installing a base theme is going to do to everything I've done. 
      Is there another solution or an update to the Paglines Customize plugin that I'm not seeing?
      Just for Information, the initial problem is:
      The ability to place a tracking pixel on an individual page to track a paid media buy. It can't be placed in the <head> of all pages or all the data will be worthless. It just needs to site on one single page. 
    • Share Bar Analytics
      By flourishdesignstudio+
      I am trying to discover a way to track the social interaction that is generated on a site that we built using DMS. We inserted the ShareBar and can see that viewers are sharing the posts/article. Is there any way that we can track who is interacting/liking/tweeting/sharing the posts?
      Are there any sort of analytics built in that I am missing?
      Thank you in advance for your help!
    • Google Analytics - How to place snippets to track?
      By LECDelhi
      Hi everyone!
      Where and how to place google snippets code in DMS to track my site in Google Analytics?
      as per Google advice - "One of the main advantages of the asynchronous snippet is that you can position it at the top of the HTML document. This increases the likelihood that the tracking beacon will be sent before the user leaves the page. It is customary to place JavaScript code in the <head> section, and we recommend placing the snippet at the bottom of the<head> section for best performance."
      So how to find the head section if I can't see the code? Any idea?