Connecting to a data supplier
Once the framework is installed, you must define the data supplier(s) for the charts to be displayed in the Analytics app dashboard. Marketers or editors can select the data suppliers you configure when they create dashboards and widgets in the Analytics app.
Data suppliers are defined under: /<module name>/dataSuppliers/<dataSupplierRegistryFile.yaml>
.
Custom external integration
If you want to integrate your own external analytics tool, implement the info.magnolia.analytics.datasource.AbstractExternalDataSupplier class, which provides credential parameters.
This class extends AbstractDataSupplier
so data filtering in the UI is also supported.
Internal data suppliers
info.magnolia.analytics.datasource.AbstractDataSupplier enables you to filter chart data using filter fields in the Magnolia UI, for example, the filters used to select a start and end date for your data.
This supplier is suitable for internal data that need filters for display purposes.
Depending on your requirements, you can configure a file-based data supplier using the class info.magnolia.analytics.datasource.FileBasedDataSupplier to fetch data from a JSON file.
For example:
class: info.magnolia.analytics.datasource.FileBasedDataSupplier
filePath: /analytics-ui/json/dummy.json
The demo dashboard shows an example of search data taken from the Magnolia Find Bar data using a custom data supplier with a limit on the number of results returned:
class: info.magnolia.analytics.datasource.FrequentlySearchAppDataSupplier
parameters:
limitTopSearch: 8
The limitTopSearch
parameter can be used when defining dashboard filters instead.
Class: info.magnolia.analytics.datasource.FrequentlySearchAppDataSupplier
The demo dashboard also shows an example of Magnolia content tags data using a custom data supplier:
class: info.magnolia.analytics.datasource.ContentTagsDataSupplier