[ANALYTICS-35] INVESTIGATION. Introduce generic chart data API Created: 22/Feb/19  Updated: 17/Apr/19  Resolved: 12/Apr/19

Status: Closed
Project: Analytics
Component/s: None
Affects Version/s: None
Fix Version/s: 1.0

Type: Story Priority: Neutral
Reporter: Laura Delnevo Assignee: Oanh Thai Hoang
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 2d 4.5h
Original Estimate: Not Specified

Issue Links:
dependency
depends upon ANALYTICS-6 Integrate to Google Analytics Closed
depends upon ANALYTICS-12 Integrate to Matomo Closed
depends upon ANALYTICS-50 Create amCharts configuration bean or... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Documentation update required:
Yes
Date of First Response:
Epic Link: Analytics backend
Sprint: Add-Ons 9
Story Points: 5

 Description   

As we integrate with GA and Matomo now we can map between connectors' response and expected data format.

Example given JSON path

 

 

Acceptant criteria:

info.magnolia.analytics.amcharts.data.JsonTemplateGeneration with #getCategoryXColumn, #getValueYColumn, #generateData method need to get from real chart data API

 

 



 Comments   
Comment by Oanh Thai Hoang [ 12/Apr/19 ]

For document:

 

Sample configure google data supplier and it's chart

chartDefinitions:
  line2GA:
    class: info.magnolia.analytics.amcharts.data.AmChartDefinition
    dataSupplier: googleSupplier
    columnDisplays:
      xCategory:
        jsonPath: $.reports[*].data.rows[*].dimensions[*]
        columnType: Category_X
        title: date
      yCategory:
        jsonPath: $.reports[*].data.rows[*].metrics[*].values[*]
        columnType: Value_Y
        title: sessions
    options:
      - name: viewId
        value: 191451330
      - name: startDate
        value: 7DaysAgo
      - name: endDate
        value: today
      - name: dimensionName
        value: ga:date
      - name: metricExpression
        value: ga:sessions
      - name: metricAlias
        value: sessions
    type: XYChart
    displaySeriesType: ColumnSeries
dataSuppliers:
  googleSupplier:
    class: info.magnolia.analytics.google.datasource.GoogleDataSupplier
    credentials:
      applicationName: Magnolia Analytics
      serviceAccountJsonPath: /analytics-google-connector/analytics/google/private_key.json 

Sample configure matomo supplier and it's chart

 

chartDefinitions:
  column2Matomo:
    class: info.magnolia.analytics.amcharts.data.AmChartDefinition
    dataSupplier: demoMatomoSupplier
    columnDisplays:
      xCategory:
        jsonPath: $.[*].city_name
        columnType: Category_X
        title: city
      yCategory:
        jsonPath: $.[*].nb_visits
        columnType: Value_Y
        title: visit
    options:
      - name: method
        value: UserCountry.getCity
      - name: idSite
        value: 3
      - name: date
        value: yesterday
      - name: period
        value: day
      - name: format
        value: json
      - name: filter_limit
        value: 10
    type: PIE
    minGridDistance: 20

dataSuppliers:
  demoMatomoSupplier:
    class: info.magnolia.analytics.matomo.datasource.MatomoDataSupplier
    credentials:
      parameters:
        serverUrl: https://demo.matomo.org
        tokenAuth: anonymous 
Generated at Sun Feb 11 23:14:51 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.