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

Add possibility to specify a limit for visits in Live.getVisitorProfile #9390

Merged
merged 4 commits into from Dec 22, 2015

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Dec 15, 2015

fixes #9046

I tried to write some tests for it but failed. Problem: I couldn't really find a fixture where we have many different visits of the same visitor. Tried to write one for a visitor having only a few visits but couldn't figure out the visitorId. I could probably get it by logging it in tracking when tests execute them but not trivial when there are also tracking requests for other users etc. It would be doable though. Does anyone maybe know a fixture defining many visits for one visitor? Then I'd add a test for it.

Also: I have not named it filter_limit or filter_offset since this would be not really correct. As mentioned here #9046 (comment) these parameters are reserved for the root element. However, lastVisits is not a root element. Applying filter_limit/filter_offset for lastVisits property would be confusing since someone else might expect it to apply for countries or another property. Therefore I added a new parameter limitVisits. Let me know if there are any other thoughts on this.

@tsteur tsteur added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Needs Review PRs that need a code review labels Dec 15, 2015
@tsteur tsteur added this to the 2.15.1 milestone Dec 15, 2015
@mattab
Copy link
Member

mattab commented Dec 21, 2015

@tsteur This fixture looks like it's got several visits by the same visitor: TwoSitesManyVisitsOverSeveralDaysWithSearchEngineReferrers

Otherwise looks good to me!

@mattab mattab changed the title Add possibility to specify a limit for vistis in Live.getVisitorProfile Add possibility to specify a limit for visits in Live.getVisitorProfile Dec 21, 2015
@tsteur
Copy link
Member Author

tsteur commented Dec 21, 2015

That one is meant for referrers. I'll create a new fixture instead...

@tsteur
Copy link
Member Author

tsteur commented Dec 21, 2015

Also it was generating many different visitors which was the problem with other fixtures as well

@tsteur
Copy link
Member Author

tsteur commented Dec 21, 2015

Added a test. Tried to squash but it has a bit of a problem when doing so because of the renaming of APITest and adding ApiTest

@mattab
Copy link
Member

mattab commented Dec 22, 2015

fyi @tsteur tests fail with PHP Fatal error: Cannot redeclare class Piwik\Plugins\Live\tests\System\ApiCounterTest in /home/travis/build/piwik/piwik/plugins/Live/tests/System/ApiCounterTest.php on line 186

@tsteur
Copy link
Member Author

tsteur commented Dec 22, 2015

Can you try again? I think it had some problems re renaming the file from APICounterTest to ApiCounterTest or so

mattab pushed a commit that referenced this pull request Dec 22, 2015
Add possibility to specify a limit for visits in Live.getVisitorProfile
@mattab mattab merged commit 290deab into master Dec 22, 2015
@mattab mattab deleted the 9046 branch December 22, 2015 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants