Support » Plugin: CAOS | Host Google Analytics Locally » Google Analytics real-time location not working in STEALTH mode

  • Resolved powercliff

    (@powercliff)


    Hello developer,
    I just find that when I enable “STEALTH mode”, the real-time location(geo location map) in Google analytics is not working. When I disable this function (and keep other setting as default), the real-time location(geo location map) in Google analytics turns normal.
    Is this a common occurrence? Or maybe I need to do some other settings? Thank you!

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Daan van den Bergh

    (@daanvandenbergh)

    Are you guys using GA4 by any chance?

    Thread Starter powercliff

    (@powercliff)

    I’m using Analytics.js, and other settings are just normal and CAO’s default settings (e.g. Plugin Handling: safe mode;Compatibility Mode:None…etc)

    Plugin Author Daan van den Bergh

    (@daanvandenbergh)

    Ok, hmmm… To further debug this issue, I’d need the following from you:

    – More information about your server setup (e.g. are you using a CDN/CloudFlare/(Page and/or Database)Caching? Any optimization plugins present?)
    – Set CAOS to Stealth Mode, Plugin handling to Experimental or Safe Mode, and enable Debug Mode. Leave it to run for a day, and send me the debug log using this form. Please do not share it here, as the debug log will contain sensitive data (i.e. IP addresses) about your visitors.

    Thread Starter powercliff

    (@powercliff)

    I use:Cloudflare, fastCGI page cache and autoptimize.
    I did the following: do not use fastCGI; deactivate all optimization plugins… the bug still exists.
    Then I think this is probably related to USING NGINX. I tested my site on Apache this morning (and keep other settings almost the same), the geo location function worked normal.

    ———–
    By the way: After the most recent update, the plugin is letting analytics connect ‘doubleclick.net’.

    Plugin Author Daan van den Bergh

    (@daanvandenbergh)

    Hi,

    The requests to doubleclick.net are only added if the ‘Disable Display Features’ option under CAOS’ Advanced Options is left unchecked. Check it to remove the Advertising Features for Google Analytics.

    I’m also running CloudFlare and Nginx on my server, and I’m not having these issues.

    When you have an opportunity, please send me the debug log as I instructed earlier. It might give us a bit more insight on why this is happening.

    Plugin Author Daan van den Bergh

    (@daanvandenbergh)

    Hi guys,

    One of my users replied to me with a possible solution to this issue recently. Could you try something for me?

    1. Go to CAOS’ plugin directory (usually wp-content/plugins/host-analyticsjs-local)
    2. Go to includes/api/class-proxy.php
    3. Remove the following lines of code, starting at line 299:

    
    if ($this->header_exists('HTTP_CF_IPCOUNTRY')) {
        $additional_params['geoid'] = $_SERVER['HTTP_CF_IPCOUNTRY'];
    }
    

    If that fixes your issue, then I know what to do to fix it in a next release 🙂

    Thread Starter powercliff

    (@powercliff)

    After removing the code, I can successfully view the real-time ip location. Thank you!

    Plugin Author Daan van den Bergh

    (@daanvandenbergh)

    Hi!

    Just wanted to let you know that this fix will be included in the next release!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Google Analytics real-time location not working in STEALTH mode’ is closed to new replies.