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

Update browser-plugins on existing visit #6408

Open
lucasHSA opened this issue Oct 9, 2014 · 1 comment
Open

Update browser-plugins on existing visit #6408

lucasHSA opened this issue Oct 9, 2014 · 1 comment
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.

Comments

@lucasHSA
Copy link

lucasHSA commented Oct 9, 2014

Hi,

it would be nice if the browser-plugin-list of the visitor is updated on each request.

This is the GitHub-Issue for this Forum-Feature-Suggestion.

Use-Case-1

If the visitor-id (uid, cid or _id) is the same, the detected plugins in the request should be used to update the "log_visit"-table. So the visitor could be found, even if the visitor-id is not present and his plugins changed during his visit.
Example (Actions of one session):

  • The user visits some pages on my website
  • Then he installs a new plugin
  • He visits some more pages on my website
  • He decides to clean his cookies -> the visitor-id gets lost
  • Again he visits some more pages on my website, but the visitor-id is not the same and his browser-plugins have changed.

So the matching by browser finger print and visitor-id fails. If the browser plugin list in the DB would have been updated during his visit, he could be found again.

Use-Case-2

I'm detecting the browser plugins with some JavaScript code, pass it to the server and track the request on server side (Java). But on the first request the detection has not yet run. So on the first request the visit is saved in the DB whiteout any browser-plugins. On the second request (and all following) the server knows the detected browser-plugins and can pass it to the piwik-tracking-api, but piwik doesn't update the browser-plugin-list of the visit (which was created on the first request).

These are the columns of the table "log_visit" which should be updated:

  • config_id <- should be recalculated after updating the other columns.
  • config_resolution
  • config_pdf
  • config_flash
  • config_java
  • config_director
  • config_quicktime
  • config_realplayer
  • config_windowsmedia
  • config_gears
  • config_silverlight
  • config_cookie

Therefore the function "onExistingVisit()" must be added to the Plugin* - Classes in "piwik / plugins / UserSettings / Columns /". The function would be called from Visit.getExistingVisitFieldsToUpdate() see "piwik / core / Tracker / Visit.php":

namespace Piwik\Plugins\UserSettings\Columns;

class PluginFlash extends VisitDimension
{
    protected $columnName = 'config_flash';
    protected $columnType = 'TINYINT(1) NOT NULL';

    /**
     * @param Request $request
     * @param Visitor $visitor
     * @param Action|null $action
     * @return mixed
     */
    public function onNewVisit(Request $request, Visitor $visitor, $action)
    {
        return Common::getRequestVar('fla', 0, 'int', $request->getParams());
    }

    /* This function is required */
    public function onExistingVisit(Request $request, Visitor $visitor, $action)
    {
        return Common::getRequestVar('fla', 0, 'int', $request->getParams());
    }
}

Mit freundlichen Grüßen aus Augsburg / Best regards from Augsburg
CADENAS GmbH
Software Development
Lucas Kögel

@mattab mattab added the Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. label Oct 9, 2014
@mattab
Copy link
Member

mattab commented Oct 9, 2014

Thanks for the suggestion to improve tracker, it's not high priority but definitely makes sense.

@mattab mattab added this to the Mid term milestone Oct 9, 2014
@mattab mattab modified the milestones: Long term, Mid term Dec 5, 2016
@innocraft-automation innocraft-automation removed this from the Backlog (Help wanted) milestone Sep 13, 2024
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.
3 participants