WordPress.org

Forums

Google Analytics by Yoast
[Plugin: Google Analytics for WordPress] Tracking Logged In User Name with Custom Variable (1 post)

  1. Ryan Miller
    Member
    Posted 2 years ago #

    Hi Joost,

    Great plugin!

    I'm trying to setup a simple idea: track downloads by username through a custom variable. This was fairly simple through manually adding the code to my theme file, but I was wondering if there was a simple way of doing this through the Filter API? I can't seem to figure it out.

    Here's the code that used to get it working:

    _gaq.push(['_setCustomVar',2,'user-name','<?php global $current_user; get_currentuserinfo(); echo $current_user->user_login ; ?>',1],['_trackPageview']);

    Thanks for anyone in the community who might be able to help!

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Google Analytics by Yoast
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic