Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to track anonymous users? #52

Open
hexsprite opened this issue Feb 5, 2015 · 5 comments
Open

How to track anonymous users? #52

hexsprite opened this issue Feb 5, 2015 · 5 comments
Labels

Comments

@hexsprite
Copy link

Is there a way to track anonymous users?

@hexsprite
Copy link
Author

I found your answer here: http://stackoverflow.com/questions/13544333/how-to-track-the-number-of-anonymous-users-server-side-in-meteor

I'm assuming I would have to look at the server side in memory UserStatus?

@mizzao
Copy link
Collaborator

mizzao commented Feb 5, 2015

Yep. You can also use the connectionX events as shown in the README.

If you want to do something on the client side, you may want to publish some information about the user as I described in #53.

@mizzao mizzao added the question label Feb 5, 2015
@KristerV
Copy link
Contributor

I find it very easy to combine mizzao:user-status with artwells:accounts-guest - it creates a guest user for the visitors, which user-status works great with out of the box.

@evolross
Copy link

Just needed to do this myself. Getting the anonymous user count is as easy as querying the in-memory UserStatus.connections collection for connections without a userId.

UserStatus.connections.find({userId: {$exists: false}}).count()

@evolross
Copy link

This leads to another question... I want to get the above anonymous user count reactively to my client... it seems this is really hard/impossible if I don't have the UserStatus.connections collection setup on my client as well so I can do a proper pub/sub. How would I create a "client version" of this collection so I can connect to the "server-only" version? Otherwise it's damn near impossible get a "server-only" var reactively to the client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants