Adobe Analytics SDK


!Node.js CI


``bash`
$ npm install
`
var sdk = require('@adobe/aio-lib-analytics');
async function sdkTest() {
//initialize sdk
const analyticsClient = await sdk.init('
}
`
Init method returns an Instance of Class AnalyticsCoreAPI
2) Call methods using initialized sdk
`
var sdk = require('@adobe/aio-lib-analytics');
async function sdkTest() {
//initialize sdk
const analyticsClient = await sdk.init('
//get report suites
const collections = await analyticsClient.getCollections({limit:5, page:0})
//get metrics
const metrics = await analyticsClient.getMetrics(rsid)
//generate report
const report = await analyticsClient.getReport(queryJSON)
}
``
All Methods available under sdk are documented here
This class provides methods to call Adobe Analytics APIs.
Before calling any method initialize the instance by calling init method on it
with valid company id, apiKey and auth token
Promise.<AnalyticsCoreAPI>Returns a Promise that resolves with a new AnalyticsCoreAPI object.
Kind: global class
* AnalyticsCoreAPI
* .init(companyId, apiKey, token) ⇒ AnalyticsCoreAPI
* .getCalculatedMetrics(options)
* .getCalculatedMetricById(id, options)
* .getCollections(options)
* .getCollectionById(rsid, options)
* .getDateRanges(options)
* .getDateRangeById(dateRangeId, options)
* .getDimensions(rsid, options)
* .getDimensionById(dimensionId, rsid, options)
* .getMetrics(rsid, options)
* .getMetricById(id, rsid, options)
* .getReport(body)
* .getSegments(options)
* .validateSegment(rsid, body)
* .getUsers(options)
* .getCurrentUser()
* .getUsageLogs(startDate, endDate, options)
Kind: instance method of AnalyticsCoreAPI
| Param | Type | Description |
| --- | --- | --- |
| companyId | string | company ID to be used with Adobe Analytics. |
| apiKey | string | Your api key |
| token | string | Valid auth token |
For more information about calculated metrics go here
Kind: instance method of AnalyticsCoreAPI
| Param | Type | Description |
| --- | --- | --- |
| options | Object | to control calculated metrics search. |
| options.calculatedMetricFilter | | Filter list to only include calculated metrics in the specified list\n(comma-delimited list of IDs). |
| options.expansion | | Comma-delimited list of additional metadata fields\nto include on response. |
| options.limit | | Number of results per page. Default 10. |
| options.locale | | Locale. |
| options.name | | Filter list to only include calculated metrics that contains the Name. |
| options.ownerId | | Filter list to only include calculated metrics owned by the\nspecified loginId. |
| options.page | | Page number (base 0 - first page is \"0\"). Default 0. |
| options.rsids | | Filter list to only include calculated metrics tied to specified\nRSID list (comma-delimited). |
| options.tagNames | | Filter list to only include calculated metrics that contains one of\nthe tags. |
For more information about calculated metrics go here
Kind: instance method of AnalyticsCoreAPI
| Param | Type | Description |
| --- | --- | --- |
| id | string | The calculated metric ID to retrieve. |
| options | Object | to control calculated metric result |
| options.expansion | | Comma-delimited list of additional metadata fields\nto include on response. |
| options.locale | | Locale. |
Kind: instance method of AnalyticsCoreAPI
| Param | Type | Description |
| --- | --- | --- |
| options | Object | to control report suites search. |
| options.expansion | | Comma-delimited list of additional metadata fields to include on\nresponse. |
| options.limit | | Number of results per page. Default 10. |
| options.page | | Page number (base 0 - first page is \"0\"). Default 0. |
| options.rsids | | Filter list to only include suites in this RSID list\n(comma-delimited). |
| options.rsidContains | | Filter list to only include suites whose rsid contains rsidContains. |
Kind: instance method of AnalyticsCoreAPI
| Param | Type | Description |
| --- | --- | --- |
| rsid | string | The rsid of the suite to return. |
| options | Object | to control eport suites search. |
| options.expansion | | Comma-delimited list of additional metadata fields to include on\nresponse. |
Kind: instance method of AnalyticsCoreAPI
| Param | Type | Description |
| --- | --- | --- |
| options | Object | to control date range search. |
| options.expansion | | Comma-delimited list of additional metadata fields to include on\nresponse. |
| options.filterByIds | | Filter list to only include date ranges in the specified list\n(comma-delimited list of IDs). |
| options.limit | | Number of results per page. Default 10. |
| options.locale | | Locale. |
| options.page | | Page number (base 0 - first page is \"0\"). Default 0. |
Kind: instance method of AnalyticsCoreAPI
| Param | Type | Description |
| --- | --- | --- |
| dateRangeId | string | The DateRange id for which to retrieve information. |
| options | Object | to control date range result. |
| options.expansion | | Comma-delimited list of additional metadata fields to include on\nresponse. |
| options.locale | | Locale. |
Kind: instance method of AnalyticsCoreAPI
| Param | Type | Description |
| --- | --- | --- |
| rsid | string | A Report Suite ID. |
| options | Object | to control dimensions search. |
| options.classifiable | | Only include classifiable dimensions. |
| options.expansion | | Comma-delimited list of additional metadata fields\nto include on response. |
| options.locale | | Locale. |
| options.reportable | | Only include dimensions that are valid within a report. |
| options.segmentable | | Only include dimensions that are valid within a segment. |
Kind: instance method of AnalyticsCoreAPI
| Param | Type | Description |
| --- | --- | --- |
| dimensionId | string | The dimension ID. For example a valid id is a value like 'evar1'. |
| rsid | string | A Report Suite ID. |
| options | Object | to control dimension result. |
| options.expansion | | Comma-delimited list of additional metadata fields\nto include on response. |
| options.locale | | Locale. |
Kind: instance method of AnalyticsCoreAPI
| Param | Type | Description |
| --- | --- | --- |
| rsid | string | A Report Suite ID. |
| options | Object | to control dimension result. |
| options.expansion | | Comma-delimited list of additional metadata fields\nto include on response. |
| options.locale | | Locale that system named metrics should be returned in. |
| options.segmentable | | Filter the metrics by if they are valid in a segment. |
Kind: instance method of AnalyticsCoreAPI
| Param | Type | Description |
| --- | --- | --- |
| id | string | The id of the metric for which to retrieve info. Note ids are values\nlike pageviews, not metrics/pageviews. |
| rsid | string | A Report Suite ID. |
| options | Object | to control dimension result. |
| options.expansion | | Comma-delimited list of additional metadata fields\nto include on response. |
| options.locale | | Locale that system named metrics should be returned in. |
Kind: instance method of AnalyticsCoreAPI
| Param | Type | Description |
| --- | --- | --- |
| body | Object | report query. |
Kind: instance method of AnalyticsCoreAPI
| Param | Type | Description |
| --- | --- | --- |
| options | Object | to control segments search. |
| options.expansion | | Comma-delimited list of additional metadata fields\nto include on response. |
| options.includeType | | Include additional segments not owned by user. The \"all\" option\ntakes precedence over \"shared\". |
| options.limit | | Number of results per page. Default 10. |
| options.locale | | Locale that system named metrics should be returned in. |
| options.name | | Filter list to only include segments that contains the Name. |
| options.page | | Page number (base 0 - first page is \"0\"). Default 0. |
| options.rsids | | Filter list to only include segments tied to specified RSID list\n(comma-delimited). |
| options.segmentFilter | | Filter list to only include segments in the specified list\n(comma-delimited list of IDs). |
| options.tagNames | | Filter list to only include segments that contains one of the tags. |
Kind: instance method of AnalyticsCoreAPI
| Param | Type | Description |
| --- | --- | --- |
| rsid | string | A Report Suite ID. |
| body | Object | JSON Segment Definition. |
Kind: instance method of AnalyticsCoreAPI
| Param | Type | Description |
| --- | --- | --- |
| options | Object | to control user search. |
| options.limit | | Number of results per page. Default 10. |
| options.page | | Page number (base 0 - first page is \"0\"). Default 0. |
Kind: instance method of AnalyticsCoreAPI
Kind: instance method of AnalyticsCoreAPI
| Param | Type | Description |
| --- | --- | --- |
| startDate | string | Start date in ISO-8601 format for the maximum of a 3 month period. |
| endDate | string | End date in ISO-8601 format for the maximum of a 3 month period. |
| options | Object | options to filter logs. |
| options.login | string | The login value of the user you want to filter logs by. |
| options.ip | string | The IP address you want to filter logs by. |
| options.rsid | string | The report suite ID you want to filter logs by. |
| options.eventType | string | The numeric id for the event type you want to filter logs by. |
| options.event | string | The event description you want to filter logs by. No wildcards permitted. |
| options.limit | number | Number of results per page. Default 10. |
| options.page | number | Page number (base 0 - first page is \"0\"). Default 0. |
Promise.<AnalyticsCoreAPI>Kind: global function
| Param | Type | Description |
| --- | --- | --- |
| companyId | string | company ID to be used with Adobe Analytics. |
| apiKey | string | Your api key |
| token | string | Valid auth token |
LOG_LEVEL=debug
Contributions are welcome! Read the Contributing Guide for more information.
This project is licensed under the Apache V2 License. See LICENSE for more information.