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

Some goal metrics are not translatable #16969

Open
sgiehl opened this issue Dec 17, 2020 · 0 comments
Open

Some goal metrics are not translatable #16969

sgiehl opened this issue Dec 17, 2020 · 0 comments
Labels
c: i18n For issues around internationalisation and localisation. Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement.

Comments

@sgiehl
Copy link
Member

sgiehl commented Dec 17, 2020

Seems some of our goal metrics currently have fixed names and documentation in English and are not translatable.

See

$custom = new GoalDimension($goal, 'idgoal', 'Conversions goal "' . $goal['name'] . '" (ID ' . $goal['idgoal'] .' )');
$custom->setType(Dimension::TYPE_NUMBER);
$custom->setSqlSegment('count(distinct log_conversion.idvisit, log_conversion.buster)');
$metric = new ArchivedMetric($custom, ArchivedMetric::AGGREGATION_SUM);
$metric->setQuery('count(distinct log_conversion.idvisit, log_conversion.buster)');
$metric->setTranslatedName($custom->getName());
$metric->setDocumentation('The number of times this goal was converted.');
$metric->setCategory($custom->getCategoryId());
$metric->setName('goal_' . $goal['idgoal'] . '_conversion');
$metricsList->addMetric($metric);
$custom = new GoalDimension($goal, 'revenue', 'Revenue goal "' . $goal['name'] . '" (ID ' . $goal['idgoal'] .' )');
$custom->setType(Dimension::TYPE_MONEY);
$metric = new ArchivedMetric($custom, ArchivedMetric::AGGREGATION_SUM);
$metric->setTranslatedName($custom->getName());
$metric->setName('goal_' . $goal['idgoal'] . '_revenue');
$metric->setDocumentation('The amount of revenue that was generated by converting this goal.');
$metric->setCategory($custom->getCategoryId());
$metricsList->addMetric($metric);
$custom = new GoalDimension($goal, 'visitor_seconds_since_first', 'Days to conversion goal "' . $goal['name'] . '" (ID ' . $goal['idgoal'] .' )');
$custom->setType(Dimension::TYPE_NUMBER);
$metric = new ArchivedMetric($custom, ArchivedMetric::AGGREGATION_SUM);
$metric->setTranslatedName($custom->getName());
$metric->setCategory($custom->getCategoryId());
$metric->setDocumentation('The number of days it took a visitor to convert this goal.');
$metric->setName('goal_' . $goal['idgoal'] . '_daystoconversion');
$metric->setQuery('sum(floor(log_visit.visitor_seconds_since_first / 86400))');
$metricsList->addMetric($metric);
$custom = new GoalDimension($goal, 'visitor_count_visits', 'Visits to conversion goal "' . $goal['name'] . '" (ID ' . $goal['idgoal'] .' )');
$custom->setType(Dimension::TYPE_NUMBER);
$metric = new ArchivedMetric($custom, ArchivedMetric::AGGREGATION_SUM);
$metric->setTranslatedName($custom->getName());
$metric->setCategory($custom->getCategoryId());
$metric->setDocumentation('The number of visits it took a visitor to convert this goal.');
$metric->setName('goal_' . $goal['idgoal'] . '_visitstoconversion');
$metricsList->addMetric($metric);

@sgiehl sgiehl added c: i18n For issues around internationalisation and localisation. c: Onboarding For issues that make the experience of getting Matomo up and running better. labels Dec 17, 2020
@tsteur tsteur removed the c: Onboarding For issues that make the experience of getting Matomo up and running better. label Dec 17, 2020
@tsteur tsteur added this to the Priority Backlog (Help wanted) milestone Dec 17, 2020
@tsteur tsteur added the Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement. label Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: i18n For issues around internationalisation and localisation. Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement.
Projects
None yet
Development

No branches or pull requests

3 participants