How to migrate Analytics module 1.1 dashboards to 1.2
Analytics module 1.2 is fully functional and not affected by the existence of 1.1 dashboards.
You can view dashboards created in 1.1, but not edit them.
We recommend you use the Analytics app delivered in 1.2 to re-create your 1.1 dashboards and widgets using the UI.
However, if you want to migrate your 1.1 dashboard and widgets to 1.2, you must:
-
Move the 1.1 data suppliers out of the dashboard definition and register new ones.
-
Include yaml from the charts instead of chartTypes.
-
Fill in the new data supplier name if you change it.
-
Fill in the dimensions and metrics into the series for Google Analytics and Adobe Analytics (in 1.1, the dimension and metric were defined in the dataSupplier). For Matomo, you don’t need to configure the metric in data supplier; you can only find the metric in the JSON path of each data field instead.
Example of migrating Abode Analytics or Google Analytics dashboards
Consider this 1.1 dashboard:
chartDefinitions:
line2GA:
class: info.magnolia.analytics.amcharts.data.AmChartDefinition
label: Session by date from GA
chartType: !include:/analytics-ui/chartTypes/column-and-bar/simple-column.yaml
# This is example how to decorate chart type to decorate data field mapping
series:
- name: series
dataFields:
- name: categoryX
jsonPath: $.reports[*].data.rows[*].dimensions[*] # Decorate jsonPath for categoryX to map data from GA
- name: valueY
jsonPath: $.reports[*].data.rows[*].metrics[*].values[*] # Decorate jsonPath for valueY to map data from GA
dataSupplier: googleSupplier
line3GA:
class: info.magnolia.analytics.amcharts.data.AmChartDefinition
label: Session by date from GA
chartType: !include:/analytics-ui/chartTypes/column-and-bar/simple-column.yaml
# This is example how to decorate chart type to decorate data field mapping
series:
- name: series
dataFields:
- name: categoryX
jsonPath: $.reports[*].data.rows[*].dimensions[*] # Decorate jsonPath for categoryX to map data from GA
- name: valueY
jsonPath: $.reports[*].data.rows[*].metrics[*].values[*] # Decorate jsonPath for valueY to map data from GA
dataSupplier: googleSupplier2
dataSuppliers:
googleSupplier:
class: info.magnolia.analytics.google.datasource.GoogleDataSupplier
credentials:
applicationName: Magnolia Analytics
serviceAccountJsonPath: /analytics-view-example/credential/private_key.json
parameters:
viewId: 24199737
startDate: 7DaysAgo
endDate: today
dimensionName: ga:date
metricExpression: ga:sessions
googleSupplier2:
class: info.magnolia.analytics.google.datasource.GoogleDataSupplier
credentials:
applicationName: Magnolia Analytics
serviceAccountJsonPath: /analytics-view-example/credential/private_key.json
parameters:
viewId: 24199737
startDate: 7DaysAgo
endDate: today
dimensionName: ga:country
metricExpression: ga:sessions
To migrate this configuration to 1.2:
-
Remove the
dataSuppliers:
section from the 1.1 definition and register a new data supplier under/<module name>/dataSuppliers/<dataSupplierRegistryFile.yaml>
.Use a name such as "newGoogleSupplier" with content cloned from the old data supplier in the old dashboard or use our predefined googleSupplier yaml definition (
/google-analytics/dataSuppliers/googleSupplier.yaml
):class: info.magnolia.analytics.google.datasource.GoogleDataSupplier credentials: applicationName: Magnolia Analytics serviceAccountJsonPath: /analytics-view-example/credential/private_key.json parameters: viewId: 24199737 startDate: 7DaysAgo endDate: today dimensionName: ga:date metricExpression: ga:sessions
-
Change the dashboard definition to:
chartDefinitions: line2GA: !include:/analytics-ui/charts/column-and-bar/simple-column.yaml # here is the change. Include from charts instead of chartTypes class: info.magnolia.analytics.amcharts.data.AmChartDefinition label: Session by date from GA chartType: # This is example how to decorate chart type to decorate data field mapping series: - name: series dimension: "ga:date" # here is the change, get dimension from "dimensionName" in old data supplier metric: "ga:sessions" # here is the change, get metric from "metricExpression" in old data supplier dataFields: - name: categoryX jsonPath: $.reports[*].data.rows[*].dimensions[*] # Decorate jsonPath for categoryX to map data from GA - name: valueY jsonPath: $.reports[*].data.rows[*].metrics[*].values[*] # Decorate jsonPath for valueY to map data from GA dataSupplier: newGoogleSupplier # here is the change, the name of datasupplier depends on your configuration line3GA: !include:/analytics-ui/charts/column-and-bar/simple-column.yaml class: info.magnolia.analytics.amcharts.data.AmChartDefinition label: Session by country from GA chartType: # This is example how to decorate chart type to decorate data field mapping series: - name: series dimension: "ga:country" # here is the change, get dimension from "dimensionName" in old data supplier metric: "ga:sessions" # here is the change, get metric from "metricExpression" in old data supplier dataFields: - name: categoryX jsonPath: $.reports[*].data.rows[*].dimensions[*] # Decorate jsonPath for categoryX to map data from GA - name: valueY jsonPath: $.reports[*].data.rows[*].metrics[*].values[*] # Decorate jsonPath for valueY to map data from GA dataSupplier: newGoogleSupplier # here is the change, the name of datasupplier depends on your configuration
Example of migrating Matomo dashboards
Consider this 1.1 dashboard:
chartDefinitions:
line-chart:
class: info.magnolia.analytics.amcharts.data.AmChartDefinition
label: line-chart
dataSupplier: demoMatomoSupplier
chartType: !include:/analytics-ui/chartTypes/line-and-area/simple-line.yaml
dataSuppliers:
demoMatomoSupplier:
class: info.magnolia.analytics.matomo.datasource.MatomoDataSupplier
credentials:
parameters:
serverUrl: https://demo.matomo.org
tokenAuth: anonymous
parameters:
method: UserCountry.getCity
module: API
idSite: 1
date: yesterday
period: day
format: json
filter_limit: 5
To migrate this configuration to 1.2:
-
Remove the
dataSuppliers:
section from the 1.1 definition and register a new data supplier under/<module name>/dataSuppliers/<dataSupplierRegistryFile.yaml>
.Use a name such as "newMatomoSupplier" with partial content cloned from the old data supplier or use our predefined demoMatomoSupplier yaml definition (
/matomo/dataSuppliers/demoMatomoSupplier.yaml
).You must use the MatomoDataSupplierWithTransformer
class from 1.2+:class: info.magnolia.analytics.matomo.datasource.MatomoDataSupplierWithTransformer credentials: parameters: serverUrl: https://demo.matomo.org tokenAuth: anonymous parameters: method: API.get module: API idSite: 1 date: last7 period: day format: json filter_limit: 5 defaultAPIMethodForTotalReport: API.get
-
Change the dashboard definition to:
chartDefinitions: line-chart: !include:/analytics-ui/charts/line-and-area/simple-line.yaml # here is the change. Include from charts instead of chartTypes class: info.magnolia.analytics.amcharts.data.AmChartDefinition label: line-chart dataSupplier: demoMatomoSupplier # here is the change. The name of datasupplier based on your config chartType: series: - name: series metric: "nb_visits" # here is the change, get metric from your previous jsonPath config in dataField valueY dimension: "UserCountry.getCity" # here is the change, get dimension from "method" in old data supplier dataFields: - name: categoryX jsonPath: "$..label" # here is the change, label is required due to structure data of MatomoDataSupplierWithTransformer - name: valueY jsonPath: "$..nb_visits" # here is the change, from your metric or your previous config