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 manage and view Intranet websites #13473

Merged
merged 22 commits into from Oct 7, 2018
Merged

Add possibility to manage and view Intranet websites #13473

merged 22 commits into from Oct 7, 2018

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Sep 24, 2018

image

image

@mattab is this what you had in mind?

need to see how to write tests for it.

fix #7724

@tsteur tsteur added Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. labels Sep 24, 2018
@tsteur tsteur added this to the 3.6.1 milestone Sep 24, 2018
@@ -65,11 +65,6 @@ class Visit implements VisitInterface
*/
protected $visitProperties;

/**
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wasn't used...

@tsteur
Copy link
Member Author

tsteur commented Sep 24, 2018

FYI: Currently no site values will be saved except for trust cookies... need to figure out a way to make this happen

@mattab
Copy link
Member

mattab commented Sep 24, 2018

Feedback:

  • Would change the inline help to This should be enabled on an intranet website for accurate unique visitor tracking. Most visitors viewing an intranet will all have the same IP address, and often the same browser and operating system, which can cause Matomo to under-report the number of visits and unique visitors (if this setting is disabled).
  • could we append eg. "Trust visitors cookies (Recommended)"
  • initially was even thinking to always enable this setting for Intranet website and not even expose it? but more flexible probably to expose it...

@mattab
Copy link
Member

mattab commented Sep 24, 2018

Also

  • let's document how to convert a website to an intranet website? Can this be done with a simple SQL query, which one? this will be useful to have somewhere documented (even if just here)

@tsteur
Copy link
Member Author

tsteur commented Sep 24, 2018

Much better could be to create a new "Intranet" website type in Core Matomo. For Intranet websites, we directly enable the trust_visitor_cookies setting. This setting becomes a "website setting" de-activable in the UI and visible only for intranet sites.

I'll remove the setting again. must have misunderstood this one.

@tsteur
Copy link
Member Author

tsteur commented Sep 24, 2018

Removed the setting again and all related tests. Makes it easier :)

Added tests for the tracking part, should work.

@tsteur tsteur added Needs Review PRs that need a code review and removed Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. labels Sep 24, 2018
@mattab
Copy link
Member

mattab commented Sep 24, 2018

must have misunderstood this one.

Forgot to reread the description so had missed this. But better we take the simplest approach 👍

} elseif ($this->didEnableSetting) {
// we reset it in case of bulk tracking with different sites etc
$this->setTrustCookiesSetting(0);
$this->didEnableSetting = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might be wrong, but I'm not sure this is needed? Could just use an else and unset it if it's not intranet.

Or is it in case another plugin decides to unset it? Actually, won't this ignore the config value then when setting it back?

"IntranetMeasurable": {
"Intranet": "Intranet",
"Intranets": "Intranets",
"IntranetDescription": "An intranet measurable is just like a website but hosted on an internal network."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since an intranet is the actual internal network, do you think "Intranet Website" might be a better term to use?

@tsteur
Copy link
Member Author

tsteur commented Sep 25, 2018

Made the changes, will likely need to fix the tests after this

$this->didEnableSetting = true;
} elseif ($this->didEnableSetting) {
// we reset it in case of bulk tracking with different sites etc
$this->setTrustCookiesSetting(0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was actually thinking about this line. If [General] trust_visitors_cookies is set to 1, then this will undo that setting, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only if we enabled it before, which we wouldn't have in this case when it is already enabled in https://github.com/matomo-org/matomo/pull/13473/files#diff-74231b57ce12fbc00990b9d88e26426dR26

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, gotcha, missed the DI get

@diosmosis
Copy link
Member

Looks like there are some integration test failures. The JsProxyTest one passes for me locally...

@tsteur
Copy link
Member Author

tsteur commented Sep 28, 2018

I'll restart the cancelled PR builds

@tsteur
Copy link
Member Author

tsteur commented Sep 28, 2018

Locally the test works for me as well

@tsteur
Copy link
Member Author

tsteur commented Oct 1, 2018

Test is still failing on travis, locally works. not sure why.

@tsteur
Copy link
Member Author

tsteur commented Oct 1, 2018

@diosmosis @mattab @sgiehl do you know why this test would check for url http://localhost//js/?idsite=1 when it says testPiwikPhp in https://github.com/matomo-org/matomo/blob/3.x-dev/tests/PHPUnit/Integration/JsProxyTest.php#L56 ?

fails probably because of a missing htaccess or so? Not sure why it suddenly fails... maybe changing to js/index.php be fine?

@diosmosis
Copy link
Member

@tsteur did you find out what the whole error was (ie, why it was getting a 400)?

@tsteur
Copy link
Member Author

tsteur commented Oct 1, 2018

Nope not yet. I'll enable debugging and see what happens

@tsteur
Copy link
Member Author

tsteur commented Oct 2, 2018

@diosmosis test should be fixed now

@diosmosis
Copy link
Member

@tsteur there are some QueuedTracking tests still failing, doesn't look expected. Maybe something breaks tracking for queued tracking?

@tsteur
Copy link
Member Author

tsteur commented Oct 3, 2018

@diosmosis should be fixed now

@diosmosis diosmosis merged commit 89d8479 into 3.x-dev Oct 7, 2018
@diosmosis diosmosis deleted the 7724 branch October 7, 2018 19:52
InfinityVoid pushed a commit to InfinityVoid/matomo that referenced this pull request Oct 11, 2018
* Add possibility to manage and view Intranet websites matomo-org#7724

* more tweaks

* ui tests

* fix some tests

* added missing name

* remove intranet setting, added test for tracking

* fix various tests

* remove test

* Update RequestProcessor.php

* Update en.json

* fix some tests

* do not throw exception if site does not exist

* seeing just now it is fine to trigger exception

* debug error

* log only certain requests

* Update piwik.php

* Update JsProxyTest.php

* trying to fix tests

* remove debug code

* trying to fix tests
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.

Add possibility to manage and view Intranet websites
3 participants