Aren’t you guys looking in the wrong directions? I think you’re better off using the "filter" option (Analytics > profile settings > filters) for this.
@Martijn: You are right, it could be a solution, but I travel a lot and therefore I haven’t a static IP...
But thanks for your suggestion!
- A small step for mankind, so why not take two...
Working with web production, graphic design/workflow, photo and education - but are trying to get a life in between!
This version should work in all contexts if you’re previewing from the Manager (though I haven’t tested it):
<?php
return $modx->user->isMember('Administrator') ? 'You are logged in.' : $modx->getChunk('GAnalytics') ;
Thanks BobRay - again!
Still no luck - but I think it’s a session cookie problem. The web/mgr context are on the same domain.tld, and the rest of the contexts are on separate domains.tld. The solution must be to write a plugin there stores the session cookies on the other contexts/domains when a admin are logged into the manager.
But thanks for your help - seeing forward to your book about Revo!
- A small step for mankind, so why not take two...
Working with web production, graphic design/workflow, photo and education - but are trying to get a life in between!
Just out of curiosity, if you put this on a page in another context, what does it show when previewing it from the Manager?
<p>Current Username: [[*username]]</p>
With
nothing.
But with:
I got my username correct in the web context, and in the rest of them: anonymous
- A small step for mankind, so why not take two...
Working with web production, graphic design/workflow, photo and education - but are trying to get a life in between!
Right, [[*username]] would be useless -- don’t know what I was thinking there.
As you suggested, it looks like you need to explicitly log in in the other contexts although I don’t see why that should be the case.