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

Allow to group by user_id in Live plugin (both API & interface) #7732

Closed
p-banaszczyk opened this issue Apr 21, 2015 · 8 comments
Closed

Allow to group by user_id in Live plugin (both API & interface) #7732

p-banaszczyk opened this issue Apr 21, 2015 · 8 comments
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.

Comments

@p-banaszczyk
Copy link

Currently we can use API or the UI to access data on visitor_id level.

Since Piwik has a user_id field that is used more often (e.g AdTruth integration), it makes sense also to allow users to access the data grouped by User ID on both API and UI level.

@ruchitrami
Copy link

+1

@mattab
Copy link
Member

mattab commented Jul 14, 2015

Hi @p-banaszczyk

the Live API with visitorId parameter is: Live.getVisitorProfile (idSite, visitorId = '', segment = '') - is your request to add userId parameter to this API?

For other APIs, it's possible to use &segment=userId==XXX to filter for a given User ID. By "Grouping by user_id" did you mean "Filter visitors to a given user_id" ?

@mattab mattab added the Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. label Jul 15, 2015
@mattab mattab added this to the Mid term milestone Jul 15, 2015
@mattab mattab modified the milestones: Long term, Mid term Dec 5, 2016
@peachp
Copy link

peachp commented Jul 27, 2019

I tried something similar with:

https://xxxxxxx.matomo.cloud/index.php?date=2019-07-26&expanded=1&filter_limit=10&format=JSON&idSite=1&method=Live.getLastVisitsDetails&module=API&period=week&segment=userId%3D@T%gmaiiiiil.com&token_auth=xxxxxxxxxxxxxxxxxxxx

It then returned I assume an array of visits, where you can also see userId. So the data could be aggregated I guess.

Is there another way to get something similar like the profile, but aggregated by userId?

@tsteur
Copy link
Member

tsteur commented Jul 28, 2019

You could do something like UserId.getUsers to get a list of users (note: the result might be truncated depending on your config settings in config/config.ini.php the value for datatable_archiving_maximum_rows_userid_users=XYZ to 50K rows). You can then use these UserIDs to request Live.getVisitorProfile for example.

In Matomo 4 we may be adding a new API Live.getVisitors which has been prepared here: #13414 where you could pass along a segment that says userId is not null

@tsteur
Copy link
Member

tsteur commented Jul 28, 2019

In general you want to use the UserId.getUsers API though I suppose. Closing this issue for now as I think we have the issue #7732 already and in general things seem maybe possible already.

In the Live API the data isn't grouped though when you apply a userId segment fyi. It returns basically only individual visits from visitors that had a userId

@tsteur tsteur closed this as completed Jul 28, 2019
@peachp
Copy link

peachp commented Jul 29, 2019

nope, I don't really need the list of users. My master DB will have them.
What I need is the data similar like returned by Live.getVisitorProfile:

https://xxxxxxxx.com/matomo/index.php?......visitorId=970e9d0cd781aed8&method=Live.getVisitorProfile&format=JSON

But for a specific User ID, not visitorId, ideally aggregated. Is it possible with the API?
It feels like accessing raw SQL data might be the only way for now?

@tsteur
Copy link
Member

tsteur commented Jul 29, 2019

If you pass the segment userId=XYZ then this should work.

@peachp
Copy link

peachp commented Jul 29, 2019 via email

@mattab mattab added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Oct 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

No branches or pull requests

5 participants