WordPress.org

Forums

Google Analytics by Yoast
[resolved] [closed] 'Demographics and Interest Reports' in Google Analytics (61 posts)

  1. Marcelo Pedra
    Member
    Posted 1 year ago #

    It's very strange, since the code looks like how Google wants it to be.
    The only thing not included by google is the CDATA expressions, but it shouldn't be affecting the Analytics' code...

    Any ideas?

  2. gabberkopf
    Member
    Posted 1 year ago #

    I just noticed, I tried with the new Google Universal Analytics profile. This type doesn't support demographics and interests reports yet afaik. But i changed back to the good old analytics and it still doesn't work.

  3. Jaime Martinez
    Member
    Posted 1 year ago #

    The code snippet provide has an error in it. But that's because this bug is locate in the source-code of Yoast it's own plugin

    Check out this version of the GA plugin
    https://github.com/jmslbam/google-analytics-for-wordpress
    It removes the extra semicolon behind the options['gajsurl'].
    It should be $this->options['gajsurl'] . "'";

    You can see the difference here GitHub Pull Request - Adjustment

    I have send the Pull-Request and I hope this works for you all.
    Please let me know

  4. Marcelo Pedra
    Member
    Posted 1 year ago #

    Hello guys, today I find Yoast website have updated the page regarding this plugin and making sure that by now it's not supporting Demographics and Interests reports:
    http://yoast.com/wordpress/google-analytics/faq/

  5. Scott Offord
    Member
    Posted 1 year ago #

    As you can see here: https://github.com/yoast/google-analytics-for-wordpress they have fixed the issue with the semicolon in their GIT repository.

    However, the repository on WordPress.org has not been updated since 2013-10-30: http://wordpress.org/plugins/google-analytics-for-wordpress/

  6. Marcelo Pedra
    Member
    Posted 1 year ago #

    @Scott Offord: I wasn't aware of a GIT version. I'll give it a try in a non-production site and see what happens.
    I'll let you know if does indeed work.

  7. Marcelo Pedra
    Member
    Posted 1 year ago #

    @Scott Offord: well boy, it works!!!!!!
    You can see here a screen capture of my Analytics account approved for Demographics and Interest Reports :D
    https://www.dropbox.com/s/r9mfx77copc6ml1/analytics%20ok.jpg

    In order to install the dev version, you need to download it from:
    https://github.com/Yoast/google-analytics-for-wordpress/archive/master.zip

    Then, go to your WP site and open the official Google Analytics for WordPress plugin page in one tab, or take a screen capture just to remember all the settings... After this, in a separate tab of your browser, goto plugins page, deactivate the plugin, delete it, and in the Add New Plugin page, upload the zip you just downloaded from github. Activate it. Go to its options page. Copy all the settings from the other tab. Save. Go to your Analytics desktop, enable Demographics and Interest Reports. Enjoy!
    ;)

    Today, I sent an angry email to Joost de Valk. I'm very sorry for that since I wasn't aware of a github dev version available. My best and more sincere apologies :)

  8. Marcelo Pedra
    Member
    Posted 1 year ago #

    Just one question: what to use?

    http://stats.g.doubleclick.net/dc.js
    or
    https://stats.g.doubleclick.net/dc.js

    I guess one should choose one or another depending on what protocol the website is using. That's what I did. Am I right?

  9. derekclair
    Member
    Posted 1 year ago #

    Worked great for me, thank you.

  10. elias.m.khoury
    Member
    Posted 1 year ago #

    Anybody knows if the dev version will be published soon?

  11. elias.m.khoury
    Member
    Posted 1 year ago #

    It worked for me :D
    I updated class-frontend.php manually in the plugin
    I hope this won't affect the next plugin update...

  12. gabberkopf
    Member
    Posted 1 year ago #

    Manual edit of the class-frontend.php file worked for me too.

  13. totels
    Member
    Posted 1 year ago #

    In theory you can put Javascript in the field for the "Host ga.js locally" option, but there's a bug in the way google-analytics-for-wordpress saves it's options, it's not correctly stripping slashes added by magic quotes, but this can be fixed without editing class-frontend.php. I have this working, as in, it's printing usable code for GA and correctly inserting the script, but due to some of the output from the Yoast plugin (extra "'" and ";") it doesn't yet Validate with Analytics.

    I created a plugin to filter the ga4wp options: https://gist.github.com/tbartels/7580798

    if ( class_exists( "GA_Admin" ) ) {
        global $ga_admin;
    
        function fix_ga4wp_slashes( $new, $old="" ) {
            return stripslashes_deep( $new );
        }
    
        add_filter( "pre_update_option_{$ga_admin->optionname}",
                "fix_ga4wp_slashes", 10, 2 );
    }

    Which makes it possible to paste in the right-hand side of the "ga.src" but you have to compensate for the quotes in the ga4wp plugin. As I said, this outputs usable code, my headers are correctly including the dc.js script, but the tracking code validation doesn't seem to parse it correctly.

  14. mmtomm
    Member
    Posted 1 year ago #

    Hi,

    has anyone an idea how I would get also the code for enhanced link attribution into the script?

    Thank you
    Tom

  15. Scott Offord
    Member
    Posted 1 year ago #

    Here's what I did, and no Demographics and Interests work for me.

    In the Google Analytics for WordPress plugin, http://scott.offord.me/Sz4W (screenshot) - check the checkbox to show the Advanced Settings

    http://scott.offord.me/Szxm (screenshots) - in the text box that says "Host ga.js locally":
    You have to provide a URL to your ga.js file: enter this URL: http://stats.g.doubleclick.net/dc.js

    Then, click the "Update Analytics Settings »" button in the plugin.

    Note, in Google Analytics: http://scott.offord.me/Szpv (screenshot) you'll have to click the "Skip Validation" button, then the next day or do, you'll start seeing Demographics and Interest info in your Google Analytics profile.

  16. kjace555
    Member
    Posted 1 year ago #

    Here's what I did, and no Demographics and Interests work for me.

    In the Google Analytics for WordPress plugin, http://scott.offord.me/Sz4W (screenshot) - check the checkbox to show the Advanced Settings

    http://scott.offord.me/Szxm (screenshots) - in the text box that says "Host ga.js locally":
    You have to provide a URL to your ga.js file: enter this URL: http://stats.g.doubleclick.net/dc.js

    Then, click the "Update Analytics Settings »" button in the plugin.

    Note, in Google Analytics: http://scott.offord.me/Szpv (screenshot) you'll have to click the "Skip Validation" button, then the next day or do, you'll start seeing Demographics and Interest info in your Google Analytics profile.

    Can anybody confirm this? What happens if you click the 'Skip Validation' button? I'm really hesitant to do that coz of the warning "if you want this account to permanently ignore this warning."

  17. wonderm00n
    Member
    Posted 1 year ago #

    I really can't understand why the plugin is not updated...

  18. halfstepdown88
    Member
    Posted 1 year ago #

    Anyone found a fix to this? I need to start recording demographics for testing on a product.

    Can we just add the google analytics code manually without using the plugin?

  19. kristink
    Member
    Posted 1 year ago #

    Also looking for a way to integrate this onto my site. A tried and true way, can't afford to break anything and I don't have a dev site to test on. Help?

  20. Scott Offord
    Member
    Posted 1 year ago #

    Kristink, halfstepdown88, the workaround I suggested works. I tried it and it works just fine.

  21. kristink
    Member
    Posted 1 year ago #

    ok i tried on one of my sites first. how soon did you start seeing the data?

  22. Scott Offord
    Member
    Posted 1 year ago #

    It shouldn't take more than 24 hours I'd think.

  23. kristink
    Member
    Posted 1 year ago #

    Not working for me. Google gave me a message about there being a threshold on the data. https://support.google.com/analytics/answer/2954071

  24. mmtomm
    Member
    Posted 1 year ago #

    @kristink:
    Same for me! Meanwhile I've added the updated analytics script manually into my header.php but this happened more than two weeks ago.
    I confess, I don't really understand, which is the quantitative meassure of the treshold to take place!
    ???

    Greets from Vienna
    Tom

  25. ncsulilwolf
    Member
    Posted 1 year ago #

    Why is this marked as resolved? I'd like to see this added to the production version of this plugin.

  26. Why is this marked as resolved?

    Because the original poster or the plugin author marked it "resolved".

    If you have a support question then per the forum welcome please start your own topic.

    http://wordpress.org/support/plugin/google-analytics-for-wordpress

  27. Casper.Ne27
    Member
    Posted 1 year ago #

    @kaleholdings
    You solution is correct, thank you man, now i got Demographics validated ;)

  28. malibumarlin
    Member
    Posted 1 year ago #

    Your solution worked for me too. Be sure that the latest code is being inserted otherwise it won't validate. I noticed the latest code published on Google: https://support.google.com/analytics/answer/2444872 differs than what is described in earlier posts.

  29. samdar
    Member
    Posted 1 year ago #

    Finally it works....!

    1) Enable the Demographic and reporting in your GA.
    2) Enable advanced settings in GA plugin.
    3) Under host files locally enter the URL http://stats.g.doubleclick.net/dc.js
    4) Click validate in GA.

    The validation should be successful.

  30. lwyndham
    Member
    Posted 1 year ago #

    A couple of months ago I tried this solution with no success, however I tried it again after seeing that other people on this thread have recently go it to work... and now it is work for me too!!!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic