WordPress.org

Ready to get started?Download WordPress

Forums

All in One SEO Pack
[resolved] Universal Analytics Not Working (17 posts)

  1. thefitrv
    Member
    Posted 3 months ago #

    Uh... I read through the other thread.
    Apparently, this was supposed to have been fixed with version 2.1.5.
    I have installed that version. Nothing happening.

    I have added my UA-6666whatever code in the plugin's configuration page.

    If I DO NOT SELECT Universal Analytics option, I get the old code to appear on my site. This is fine, and this is how I'm running now since it's broken.

    However, if I select the checkbox for Universal Analytics - I get no code at all appearing on the site. Nothing. Nada.

    I have NOT selected or entered anything for domain tracking, outbound links, advertising whatever, or any of the other options related to GA.

    Strangely, if I click the button "Connect with Google Analytics", I am presented with a login page, and it appears to connect WITH THE WRONG PROPERTY in Google Analytics. No option to select a property or fix it. So I've backed out of that option as well.

    Any clue why none of this is working (except the old code, thank goodness!)?

    https://wordpress.org/plugins/all-in-one-seo-pack/

  2. Peter Baylies
    Member
    Plugin Author

    Posted 2 months ago #

    Hi thefitrv,

    If you click the button, after you connect, you should get a drop-down with the associated properties, if any. If you have your code entered and you check Universal Analytics, obviously you should end up with that tracking code appearing in your source code. If you'd like to troubleshoot this further, set it up and give me the url for your website, and I can take a look at what's being output.

  3. thefitrv
    Member
    Posted 2 months ago #

    Hi. Sorry, I've been out on vacation.
    I tried again. Didn't work.

    Here is what the setup screen looks like before I click the button. The old-style analytics work fine and put this tracking code on my pages properly. Notice that the property id ends in "-2", which is correct:

    Before UA

    Now here's what it looks like after clicking the connect button, and enabling universal analytics. Notice that the property with "-2" is not even available to select, though it it very much in my analytics account:

    After UA

    I decided I can't leave it set this way because the two sites aren't related at all, and I don't want to misreport, well, everything. For now, I'm just leaving the old tracking code there.

    I will see if I have a site that I don't care about, using the same host, where I can enable the bad tracking code and we'll see what happens there.

    Any other ideas?

  4. Peter Baylies
    Member
    Plugin Author

    Posted 2 months ago #

    Hi thefitrv,

    I see the other property is the same except that it ends in -3 -- do you have both of those properties associated with the same Google account? I'd be interested to know why one of them is showing up and the other isn't. However, note that you can check Universal Analytics and you don't have to click the connect button at all, you can just keep your property id filled in manually. Just make sure in your Google account that the property id in question is indeed set up to use Universal Analytics.

  5. thefitrv
    Member
    Posted 2 months ago #

    I tried that initially. Just tried it again with the same result.

    Right now, I have Universal Analytics checked, and my correct UA property ID filled in.

    But there is no Google Analytics tracking code (old or UA version) on the site at all. I can leave this up for a couple hours. It won't count traffic, but at least it won't credit it to the wrong property.

    Site is http://www.thefitrv.com

    Let me know if you see anything. (and yes, I just cleared the cache)

    Thanks

  6. Peter Baylies
    Member
    Plugin Author

    Posted 2 months ago #

    Hi thefitrv,

    That page is not only cached by WP Super Cache, but it's also minified, with comments stripped, and it looks like probably run through CloudFlare as well. It looks like "autoptimize" is pulling your inline Javascript out of the page and into another Javascript file (at the bottom of the page), and that is where your Google Analytics ID is showing up. In the future I'd suggest doing your testing on a development server if possible, with all cache-related plugins and services and minification disabled.

  7. thefitrv
    Member
    Posted 2 months ago #

    Peter -

    Thank you. I'm appropriately embarrassed now. I should have checked *all* the linked .js on the page. My bad.

    As an FYI though - in case anyone else sees this - with the previous, Non-UA tracking code, autoptimize left it alone, and the Google Analytics code was plainly visible on the page itself - not linked.

    When switched to UA, autoptimize now catches the new Google Analytics tracking code, and moves it to the autoptimized and linked js file. Some strange interaction between the plugins I suppose.

    Thanks again, and I owe you a donation.

  8. Peter Baylies
    Member
    Plugin Author

    Posted 2 months ago #

    thefitrv,

    Cheers, I'm glad that helped you out. Strange that the code gets moved in one case and not in the other, though - it should be basically identical if you're using Universal Analytics for both.

  9. futtta
    Member
    Posted 2 months ago #

    Hi guys;
    I'm AO's developer. AO automatically excludes GA old-style tracking from aggregation. I'll exclude UA-tracking code by default in the next minor release, you can now just add it to the JS optimization exclusion-list yourself. Any unique string in the UA-JS that would be a good candidate to base exclusion on?

    kind regards,
    frank

  10. Peter Baylies
    Member
    Plugin Author

    Posted 2 months ago #

    Hi Frank,

    Thanks for the heads up; the start of the tracking code JS should be pretty unique - "(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']"

  11. futtta
    Member
    Posted 2 months ago #

    Great!

    thefitrv; can you try excluding "GoogleAnalyticsObject" in that case?

    frank

  12. thefitrv
    Member
    Posted 2 months ago #

    OK. Added "GoogleAnalyticsObject" to the exclude list. The list now looks like this:

    s_sid,smowtion_size,sc_project,WAU_,wau_add,comment-form-quicktags,edToolbar,ch_client,GoogleAnalyticsObject

    Google Analytics tracking code - Universal Analytics version - is now appearing on the pages themselves, and is no longer in the Autoptimized and linked .js file.

    So basically, now all is working as it used to - but with the new UA code.

    Two questions - and I don't mean to hijack my own thread to a different topic, but here goes:

    1: I assume from this that it's better to NOT autoptimize/minify the Google Analytics code. But why?

    2: Will I need to remove this exclusion when the next version of AO is released?

    Thanks both of you for the help.

  13. futtta
    Member
    Posted 2 months ago #

    1. GA needs to be inline in order to work
    2. no, it could stay there.

    glad it works!
    frank

  14. futtta
    Member
    Posted 2 months ago #

    The test-version of 1.8.5, which I committed to the trunk-build yesterday, now excludes Universal Analytics from being aggregated. It would be great if you could download & test to confirm this does work (do remove the "GoogleAnalyticsObject" from your custom exclude list, otherwise this would not be a good test)?

    frank

  15. thefitrv
    Member
    Posted 2 months ago #

    Removed GoogleAnalyticsObject from the exclude list and added your new version. Everything seems to work as it should.

    Should I just leave this version live until 1.8.5 is released? Or take it out and go back to 1.8.4 and wait for the official release? It would be easier to just leave this version live, as long as there are no other risks.

    Thanks

  16. futtta
    Member
    Posted 2 months ago #

    You can leave this one, once the new version is pushed out (probably early next week) you'll receive the update to the final 1.8.5 (which will probably be limited to changes in the readme.txt anyway).

    frank

  17. thefitrv
    Member
    Posted 2 months ago #

    OK.

    Have to admire the collaboration on this one.
    Thanks to the both of you!

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.