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

Tour.getEngagement is called on every page load #14648

Closed
diosmosis opened this issue Jul 10, 2019 · 4 comments · Fixed by #14665
Closed

Tour.getEngagement is called on every page load #14648

diosmosis opened this issue Jul 10, 2019 · 4 comments · Fixed by #14665
Assignees
Labels
c: Performance For when we could improve the performance / speed of Matomo.
Milestone

Comments

@diosmosis
Copy link
Member

The Tour.getEngagement API method is called on every page load (including modals) even if there is no tour widget visible. Shouldn't need to call it this often, instead it should only be used if there's a tour widget visible.

@diosmosis diosmosis added this to the 3.11.0 milestone Jul 10, 2019
@tsteur
Copy link
Member

tsteur commented Jul 10, 2019

@diosmosis there is no such API. I suppose you mean a different API?

@diosmosis
Copy link
Member Author

@tsteur in plugins/Tour/javascripts/engagement.js there's an AJAX call to Tour.getEngagement (though it looks like it could be a controller method?). That's what I was seeing.

@tsteur
Copy link
Member

tsteur commented Jul 11, 2019

Didn't look too much into it but I reckon this is only once the dashboard was opened and it contains the default dashboard. And it should only do it after the window was focused again (like moved to another tab and then back). Might not be big of an issue but ideally definitely should be only executed when we're on the dashboard and when the widget is on the dashboard.

@sgiehl
Copy link
Member

sgiehl commented Jul 15, 2019

jQuery(window).off('focus.tourEngagement').on('focus.tourEngagement', function () {
tourEngagement.goToPage({{ currentPage|e('js') }});
});

That event isn't actually unloaded when switching the page. So it's executed on every page once the dashboard was loaded with the widget.

@tsteur tsteur self-assigned this Jul 18, 2019
@tsteur tsteur added the c: Performance For when we could improve the performance / speed of Matomo. label Jul 18, 2019
@mattab mattab modified the milestones: 3.11.0, 3.12.0 Jul 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Performance For when we could improve the performance / speed of Matomo.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants