WordPress.org

Ready to get started?Download WordPress

Forums

Google Analytics for WordPress
"Anonymous" Tracking isn't at all anonymous. (2 posts)

  1. Aaron Harun
    Member
    Posted 1 year ago #

    How are site_url() and get_bloginfo( 'name' ) "anonymous" tracking in plugin? Shame on you.

    $data = array(
    	'site'     => array(
    		'hash'      => $hash,
    		'url'       => site_url(),
    		'name'      => get_bloginfo( 'name' ),
    		'version'   => get_bloginfo( 'version' ),
    		'multisite' => is_multisite(),
    		'users'     => $wpdb->get_var( "SELECT COUNT(*) FROM wp_users INNER JOIN wp_usermeta ON (wp_users.ID = wp_usermeta.user_id) WHERE 1 = 1 AND ( wp_usermeta.meta_key = 'wp_{$blog_id}_capabilities' ) " ),
    		'lang'      => get_locale(),
    	),
    	'pts'      => $pts,
    	'comments' => array(
    		'total'    => $comments_count->total_comments,
    		'approved' => $comments_count->approved,
    		'spam'     => $comments_count->spam,
    		'pings'    => $wpdb->get_var( "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_type = 'pingback'" ),
    	),
    	'options'  => apply_filters( 'yoast_tracking_filters', array() ),
    	'theme'    => $theme,
    	'plugins'  => $plugins,
    );
    
    $args = array(
    	'body' => $data
    );
    wp_remote_post( 'https://tracking.yoast.com/', $args );

    http://wordpress.org/extend/plugins/google-analytics-for-wordpress/

  2. Ov3rfly
    Member
    Posted 1 year ago #

    To anonymize the tracking, you could use e.g. something like this in your functions.php...

    function my_pre_http_request( $val, $args, $url ) {
    	if ( stripos( $url, 'tracking.yoast.com' ) !== false ) {
    		// edit args, untested:
    		$args['body']['site']['url'] = 'whatever';
    		...
    		// return true; // <- this would stop the whole request
    	}
    	return $val;
    }
    add_filter( 'pre_http_request', 'my_pre_http_request', 10, 3 );

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.