matomo-org / matomo-org/plugin-Provider

Allow to reattribute provider with `./console usercountry:attribute`

Open
#44 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
4
Forks
5
Avg merge
3h 22m
Merged PRs (30d)
8

Description

After installing the provider plugin and the ISP provider databases I assumed that you can also use `php ./console usercountry:attribute` to update the `location_provider` database field. This does not work, after running the command the historical log data was not updated.

When looking at the code, the class `VisitorGeolocator.php` in the UserCountry plugin does not even call the provider plugin to update the data. Actually the geolocator data is directly populated by the `VisitorGeolocator` without going through the abstractions, it just uses a map which fields in the log entry to update. `location_provider` is not part of this list of fields to update.

I am not sure how to fix this in the current architecture, because the extra field in the Provider plugin is unknown to UserCountry plugin, so just hacking it into the script won't work.

Is there any way to run the Geolocator in the same way like for UserCountry?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing ./console usercountry:attribute into VisitorGeolocator.php in the UserCountry plugin, paying attention to the field map and how the Provider plugin is accessed. Determine how historical log data should update location_provider without breaking the plugin abstraction. Done means the command reattributes existing records through the provider and verifies the location_provider field is updated.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, cli, databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.