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

share specific dashboard views without sharing your token #5164

Closed
anonymous-matomo-user opened this issue May 13, 2014 · 9 comments
Closed
Labels
duplicate For issues that already existed in our issue tracker and were reported previously. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Milestone

Comments

@anonymous-matomo-user
Copy link

if anonymous users are able to view my site information, i should be able to share a specific dashboard view without sharing my token.

as it looks now, it isn't possible to share a dashboard view without giving a user the ability to modify it.

perhaps make the widget layout loadable by url parameters?

@anonymous-matomo-user
Copy link
Author

we have been looking into working around this:

individual widgets can be shown in their own iframe, BUT

  1. there is no parameter for segmenting,
  2. we have to manually do updating of layout/sizing if we want multiple widgets on a page, or allow those widgets to change size (in the case of a user going from 25-50 results shown, etc...)
  3. we will have to make our own date selection widget and transfer that range to the child iframes

another option is to create some fake account with just view permissions, but then anyone who we share this token with can modify the dashboard view. if there was a read only setting it would be helpful

@anonymous-matomo-user
Copy link
Author

another workaround i have been using:

this is for Dashboard.php, in the first line of

public function getDefaultLayout()
{

65,69c65
< $dashPath = Common::getRequestVar('dashLayoutPath', '', 'string');
< if (!empty($dashPath)){
< return file_get_contents('http://intrawebdev2' . $dashPath);
< }

...

i modified the php to look for a parameter specifying where the json string describing the default layout is

this file has to be on the same server, but then you can dynamically specify the default layout for widgets on a dashboard

this solution breaks down:
-if the user is signed in (i think cookie handling overrides the default dashboard later?)
-if the anonymous user changes the view, and then comes back to the page, the changes remain, where that may not be the best behavior (again probably cookies)

@mattab
Copy link
Member

mattab commented May 25, 2014

Thanks for the feature suggestion we appreciate your feedback.

@anonymous-matomo-user anonymous-matomo-user added this to the Future releases milestone Jul 8, 2014
@tsteur
Copy link
Member

tsteur commented Aug 3, 2014

A user asked me for this feature at the meet up as well. It makes completely sense and it would be great to be able to generate a link to share a dashboard layout as well as the widget and params it includes with someone else. It would not share any data but only the structure of the dashboard. Maybe we can work on this short / mid term

@mattab mattab modified the milestones: Long term, Mid term Aug 3, 2014
@mattab
Copy link
Member

mattab commented Aug 3, 2014

@tsteur moved this Mid term milestone.

@integrationtester
Copy link

a little more detail on my hack solution

//this loads a dashboard layout from a given path (we put this on the same web accessable server)
/piwik/plugins/Dashboard/Dashboard.php
63 public function getDefaultLayout()
64 {
65 $dashPath = Common::getRequestVar('dashLayoutPath', '', 'string');
66 if (!empty($dashPath)){
67 return file_get_contents('http://intrawebdev2' . $dashPath);
68 }
69 $defaultLayout = $this->getLayoutForUser('', 1);

//this prints out the current dashboard layout to the console
/piwik/plugins/Dashboard/javascripts/dashboard.js
7
8 function initDashboard(dashboardId, dashboardLayout) {
9 console.log(JSON.stringify(dashboardLayout));

//if you are anonymous, and a dashboard layout is specified, it overrides your current layout
/web/public/htdocs/projects/applog/piwik/plugins/Dashboard Controller.php

change this:
if (!isset($session->dashboardLayout)) {

             return $this->dashboard->getDefaultLayout();

}

to this: (remove check for if you have a session layout)
return $this->dashboard->getDefaultLayout();

the summary of the workflow is:

  1. set up the piwik view
  2. press f12 to bring up the console
  3. reload the page
  4. copy the json output (representing the current layout) from the console, to a file, put it in a web accessible location
  5. specify dashLayoutPath= in the piwik links you share

@tsteur
Copy link
Member

tsteur commented Aug 5, 2014

The URL could maybe get too long when including the whole layout? Any experience with this? Ideally, we would allow to share dashboards between Piwik instances which requires to either export the whole dashboard layout as in previous example or we need another service where dashboard layouts are sent to.

Another solution could be when to generate a long token and store the layout together with the token in the database. Under this token which would be valid for 1hour or 1 day or 1 week or 1 month or whatever any anonymous user could then export the token from this instance and import to another by copy/pasting the link of the other instance. Does not really feel like an ideal solution though.

In the beginning it would be enough to share layouts between the same instance. One problem is for instance when dashboard layout structure changes in a later version we cannot share between this and older Piwik versions etc.

@integrationtester
Copy link

on my hack method, the layout is stored on the filesystem and the url just points to it, so there isn't a worry about url length

it would be nice to be able to share views between installations, but like you say versioning sounds pretty difficult to do.

sharing layouts in just the same instances is more than enough for us.

thanks for thinking about this

@mattab
Copy link
Member

mattab commented Jan 13, 2015

Covered in #6964

@mattab mattab added the duplicate For issues that already existed in our issue tracker and were reported previously. label Jan 13, 2015
@mattab mattab closed this as completed Jan 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate For issues that already existed in our issue tracker and were reported previously. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Projects
None yet
Development

No branches or pull requests

4 participants