[ASSISTANCE] Piwik Showing Logged in Members (Forum) Info

Posted by Azounstone 

Advanced
March 08, 2012 05:44AM
Hi all,

I am hoping somebody can help me revise my piwik code so that it shows our forum members display name as Clicky currently does in place of the IP showing for the visitor ID? The code I use for Clicky to do this is shown below (site I.D. XXXX'd out):
<!-- START CODE - Clicky -->
<script type="text/javascript">
var clicky_site_ids = clicky_site_ids || [];
clicky_site_ids.push(xxxxxxxx);
(function() {
  var s = document.createElement('script');
  s.type = 'text/javascript';
  s.async = true;
  s.src = '//static.getclicky.com/js';
  ( document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0] ).appendChild( s );
})();
  var clicky_custom = {};
  clicky_custom.session = {
    username: "{$this->memberData['members_display_name']}",
    group: "User"
  };
</script>
<!-- END CODE - Clicky -->
I am using this code for Piwik:
<!-- Piwik -->
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://domain.com/piwik/" : "http://domain.com/piwik/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 1);
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
</script><noscript><p><img src="http://domain.com/piwik/piwik.php?idsite=1" style="border:0" alt="" /></p></noscript>
<!-- End Piwik Tracking Code -->
If any one could adjust the Piwik code to include the relevant changes I would be most appreciative!

Many thanks in advance for your help with this smiling smiley

Andy



Edited 1 time(s). Last edit at 03/08/2012 06:13AM by Azounstone.
matt [ # ]
March 08, 2012 09:47AM
see [piwik.org]



Cheers,
Matt
Piwik founder

Piwik FAQ - Piwik Help - before posting a new topic
Stay tuned on the Piwik Blog. You may follow me on twitter & on github

March 08, 2012 05:17PM
Hi Matt,

I of course read through all of the info regarding custom variables before posting. I posted as after reading it I didn't know what to adjust in the code to get the results I am looking for hence my post hoping one of the community that is more technically minded than me (not difficult) would be kind enough to help smiling smiley

If any one could adjust the Piwik code to include the relevant changes I would be most appreciative!

Many thanks in advance for your help with this smiling smiling smiley

Andy
matt [ # ]
March 08, 2012 07:50PM
piwikTracker.setCustomVariable(1, "username", "{$this->memberData['members_display_name']}" );
// this is before the call to trackPageView()



Cheers,
Matt
Piwik founder

Piwik FAQ - Piwik Help - before posting a new topic
Stay tuned on the Piwik Blog. You may follow me on twitter & on github

March 08, 2012 08:22PM
Awesome thanks Matt.

What I am trying to do is have the Member name (forum user) showing on the latest visitor info for example in place of the IP address or next to it.


matt [ # ]
March 08, 2012 08:25PM
Custom variables will show up in the Visitors> visitor log



Cheers,
Matt
Piwik founder

Piwik FAQ - Piwik Help - before posting a new topic
Stay tuned on the Piwik Blog. You may follow me on twitter & on github

March 08, 2012 11:08PM
Hi,

Okay so noway to actually have it shown in real time visitor info too then if I understand this correctly?

Thanks for helping smiling smiley

Andy
March 09, 2012 03:15AM
Unable to post the code as it puts smilies in place of ) so attached an image.

Am I correct with my assumption in my last post in this thread?


March 09, 2012 03:17AM
Quote
Azounstone
Hi,

Okay so noway to actually have it shown in real time visitor info too then if I understand this correctly?

Thanks for helping smiling smiley

Andy
Confirmation on this would be much appreciated smiling smiley
Sorry, only registered users may post in this forum.

Click here to login

Free Forum support is provided by the Piwik Community. If you require any urgent or professional help, contact Piwik Professional Services team!