Viewing 7 replies - 1 through 7 (of 7 total)
  • I did some little changes to accomlish that..
    look for the functions and replace and add the code…
    hopefully the author will update it..?

    save-ga-local.php:
    function register_save_ga_locally_settings() {
    ……
    register_setting (‘save-ga-locally-basic-settings’,’sgal_use_anonymize_ip’);
    …..
    }

    <h2>Host Google Analytics Locally</h2>
    ……
    $sgal_use_anonymize_ip = esc_attr(get_option(‘sgal_use_anonymize_ip’));
    …..

    … and then a bit further at the end of the table..
    ………..
    <tr valign=”top”>
    <th scope=”row”>Use anonymize ip?</th>
    <td><input type=”checkbox” name=”sgal_use_anonymize_ip” <?php if($sgal_use_anonymize_ip == “on”) echo ‘ checked ‘ ?>/></td>
    </tr>
    </table>
    …………

    function add_ga_header_script() {
    ……………add this at the top of the function
    $sgal_use_anonymize_ip = esc_attr(get_option(‘sgal_use_anonymize_ip’));
    ……..

    ……..add this at the end of the function and replace the existing code
    $_anonymize_ip = “”;
    if($sgal_use_anonymize_ip == “on”)$_anonymize_ip = “ga(‘set’, ‘anonymizeIp’, true);”;
    echo “ga(‘create’, ‘” . $sgal_tracking_id . “‘, ‘auto’);
    “.$_anonymize_ip.”
    ga(‘send’, ‘pageview’);
    </script>”;
    }

    thats it. only deactivate and reactivate , then adjust the pluginoptions in the backend.

    works like a charm.

    Thread Starter chris1407

    (@chris1407)

    Great work, thx for your help.

    Plugin Author DaanvandenBergh

    (@daanvandenbergh)

    Another user recently e-mailed me with the same question. I wasn’t aware that Germany actually required this feature within Analytics-code. Thanks for notifying me. In the next release I will add this option!

    Plugin Author DaanvandenBergh

    (@daanvandenbergh)

    I think you will be very happy with the new release, @chris1407 and @arcticblue! ??

    Thread Starter chris1407

    (@chris1407)

    Thx for the update, very nice ??

    Plugin Author DaanvandenBergh

    (@daanvandenbergh)

    Denis Abendroth just pointed out a mistake in the tracking code. The right order is create, set anonymizeIP, send.

    I immediately added an update (version 1.36) which fixes this issue. In version 1.35 it’s set anonymizeIP, create, send. Which I’m not sure will work right! So update your plugin!

    Plugin Author DaanvandenBergh

    (@daanvandenbergh)

    @chris1407, as of v1.41 the plugin also supports the not tracking of admin users. ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Anonymize and Admin User’ is closed to new replies.