This is a staging build of the docs
We've reorganized our products to make building with Codat easier than ever
Skip to main content

Marketing metrics

Reference document for the ratios and metrics produced by the marketing metrics endpoint

The Marketing Metrics endpoint retrieves the marketing to revenue and marketing to expense metrics over one or more periods of time. These marketing metrics are calculated from accounting data. It is generated from data available on the customer's profit and loss statement.

Refer to the Assess reporting structure page for more detail on reports in Assess.

For Marketing Metrics, these are the dimensions and measures:

Dimensions

  • Period
  • Marketing metrics
  • Metric inputs: displays only when showInputValues is set to true.

Measures

  • Percentage
  • Percentage change
  • Value

Report Data

  • Is structured based on dimension (index =“0”), i.e. Period.
  • The endpoint will return marketing to expense and marketing to revenue metrics for each period.

View the Marketing Metrics formulas.

GET /data/companies/{companyId}/connections/{connectionId}/lending/accountingMetrics/marketing

Parameters

ParameterTypeDescriptionRequired
reportDatestring
See Date
YYYY-MM-DD
Datetime or Date (inclusive of the whole day).
Required
periodLengthintegerBased on the period unit provided.
It must be positive, not zero and an integer.
Required
numberOfPeriodsintegerThe number of periods to return.
It must be positive, not zero and an integer.
Required
includeDisplayNamesbooleanShows the dimensionDisplayName and itemDisplayName in measures to make the report data human-readable. Default is false.Optional
showInputValuesbooleanIf set to true, then the system includes the input values within the response.
Default to false.

Data model

The response structure is split into four areas: Report info, Dimensions, Measures and Report data.

Report info

FieldTypeDescription
namestring"marketing_metrics"
displayNamestring"Marketing metrics"

Dimensions

Marketing metrics consists of these dimensions: Period, Marketing metrics and Metric inputs.

Dimension (index = “0”): Period

FieldTypeDescription
displayNamestring"Period"
typestring"datespan"
itemsarray
See Dimension (index = “0”) items
Returns an array of “Period”. This is driven by the query parameter values.
Ordered by latest to earliest periods.

Dimension (index = “0”) items

FieldTypeDescription
displayNamestring"Period n"
startstring
See Date
YYYY-MM-DD
Date in which the period begins (inclusive).
endstring
See Date
YYYY-MM-DD
Date in which the period ends (inclusive).

Dimension (index = “1”): Marketing metrics

FieldTypeDescription
displayNamestring"Marketing metrics"
typestring"string"
itemsarray
See Dimension (index = “1”) items
Returns an array of marketing metrics.

Dimension (index = “1”) items

FieldTypeDescription
displayNamestring"Marketing metrics"
typestring"string"
itemsarray
See Dimension (index = “1”) items
Returns an array of marketing metrics.

Dimension (index = "2"): Metric inputs

This displays when the showInputValues is set to 'true'.

FieldTypeDescription
displayNamestring"Metric inputs"
typestring"string"
itemsarray
Dimension (index = “2”) items

Dimension (index = "2") items

FieldTypeDescription
valuestring"Operating income" or "Operating expense" or "Marketing expense".
This shows when showInputValues is set to true in the user's query parameters.

Measures

Measures provide information about the measures contained in the report data.

The measure for this report is as follows:

Index “0” - Percentage

FieldTypeDescription
displayNamestring“Percentage”
unitsstring"%"
typestring“percentage”

Index “1” - Percentage change

FieldTypeDescription
displayNamestring“Percentage change vs previous period”
unitsstring"%"
typestring“percentage”

Index “2” - Value

FieldTypeDescription
displayNamestring“Value”
unitsstringThe currency of the P&L.
typestring“currency”

Report data

The report data combines multiple reporting dimensions and outputs the value of each combination. Each dimension reference is specified.

Since the report data is reflective of two dimensions and their measures, the tables below represent each component grouping.

Each object is grouped by dimension (index=“0”) which is the number of periods specified by the user in the query parameters.

Each period will be broken down into Marketing metrics, Metric inputs.

Components are nested within each other as below (grouped by dimension (index =“0”), i.e. Period).

components - “Marketing metrics", e.g. Marketing to expense
components - “Metric inputs”, e.g. Operating expense

Components structure

FieldTypeDescription
dimensionnumberIndex 1 and 2, see dimensions.
dimensionDisplayNamestringShows when includeDisplayNames is set to true.
itemnumber
itemDisplayNamestringShows when includeDisplayNames is set to true.
measuresSee Measures in components

All components have the structure described in the Measures in components data model below.

Measures in components

Index “0” (percentage)

FieldTypeDescription
measureDisplayNamestring“Percentage"
valuestring"%"

Index “1” (percentage change)

FieldTypeDescription
measureDisplayNamestring“Percentage change"
If the system can't calculate the percentage change, this object will not display.
valuestring"%"

Index "2" (value)

FieldTypeDescription
measureDisplayNamestring"Value"
valuenumber

Example data

{
"reportInfo": {
"name": "marketing_metrics",
"displayName": "Marketing metrics"
},
"dimensions": [
{
"index": 0,
"displayName": "Period",
"type": "datespan",
"items": [
{
"index": 0,
"displayName": "Period 0",
"start": "2021-03-01",
"end": "2021-03-31"
},
{
"index": 1,
"displayName": "Period 1",
"start": "2021-04-01",
"end": "2021-04-30"
}
]
},
{
"index": 1,
"displayName": "Marketing metrics",
"type": "string",
"items": [
{
"index": 0,
"value": "Marketing to revenue"
},
{
"index": 1,
"value": "Marketing to expense"
}
]
},
{
"index": 2,
"displayName": "Metric inputs",
"type": "string",
"items": [
{
"index": 0,
"value": "Operating income"
},
{
"index": 1,
"value": "Operating expense"
},
{
"index": 2,
"value": "Marketing expense"
}
]
}
],
"measures": [
{
"displayName": "Percentage",
"units": "%",
"index": 0,
"type": "percentage"
},
{
"displayName": "Percentage change vs previous period",
"units": "%",
"index": 1,
"type": "percentage"
},
{
"displayName": "Value",
"units": "GBP",
"index": 2,
"type": "currency"
}
],
"reportData": [
{
"dimension": 0,
"dimensionDisplayName": "Period",
"item": 0,
"itemDisplayName": "Period 0",
"components": [
{
"dimension": 1,
"dimensionDisplayName": "Marketing metrics",
"item": 0,
"itemDisplayName": "Marketing to revenue",
"measures": [
{
"index": 0,
"measureDisplayName": "Percentage",
"value": 1.41
},
{
"index": 1,
"measureDisplayName": "Percentage change vs previous period",
"value": -32.32
}
],
"components": [
{
"dimension": 2,
"dimensionDisplayName": "Metric inputs",
"item": 0,
"itemDisplayName": "Operating income",
"measures": [
{
"index": 2,
"measureDisplayName": "Value",
"value": 15964.55
}
]
},
{
"dimension": 2,
"dimensionDisplayName": "Metric inputs",
"item": 2,
"itemDisplayName": "Marketing expense",
"measures": [
{
"index": 2,
"measureDisplayName": "Value",
"value": 225.19
}
]
}
]
},
{
"dimension": 1,
"dimensionDisplayName": "Marketing metrics",
"item": 1,
"itemDisplayName": "Marketing to expense",
"measures": [
{
"index": 0,
"measureDisplayName": "Percentage",
"value": 2.61
},
{
"index": 1,
"measureDisplayName": "Percentage change vs previous period",
"value": -20.61
}
],
"components": [
{
"dimension": 2,
"dimensionDisplayName": "Metric inputs",
"item": 1,
"itemDisplayName": "Operating expense",
"measures": [
{
"index": 2,
"measureDisplayName": "Value",
"value": 8616.69
}
]
},
{
"dimension": 2,
"dimensionDisplayName": "Metric inputs",
"item": 2,
"itemDisplayName": "Marketing expense",
"measures": [
{
"index": 2,
"measureDisplayName": "Value",
"value": 225.19
}
]
}
]
}
]
},
{
"dimension": 0,
"dimensionDisplayName": "Period",
"item": 1,
"itemDisplayName": "Period 1",
"components": [
{
"dimension": 1,
"dimensionDisplayName": "Marketing metrics",
"item": 0,
"itemDisplayName": "Marketing to revenue",
"measures": [
{
"index": 0,
"measureDisplayName": "Percentage",
"value": 13.8
},
{
"index": 1,
"measureDisplayName": "Percentage change vs previous period",
"value": 878.47
}
],
"components": [
{
"dimension": 2,
"dimensionDisplayName": "Metric inputs",
"item": 0,
"itemDisplayName": "Operating income",
"measures": [
{
"index": 2,
"measureDisplayName": "Value",
"value": 5362.39
}
]
},
{
"dimension": 2,
"dimensionDisplayName": "Metric inputs",
"item": 2,
"itemDisplayName": "Marketing expense",
"measures": [
{
"index": 2,
"measureDisplayName": "Value",
"value": 740.11
}
]
}
]
},
{
"dimension": 1,
"dimensionDisplayName": "Marketing metrics",
"item": 1,
"itemDisplayName": "Marketing to expense",
"measures": [
{
"index": 0,
"measureDisplayName": "Percentage",
"value": 8.29
},
{
"index": 1,
"measureDisplayName": "Percentage change vs previous period",
"value": 217.17
}
],
"components": [
{
"dimension": 2,
"dimensionDisplayName": "Metric inputs",
"item": 1,
"itemDisplayName": "Operating expense",
"measures": [
{
"index": 2,
"measureDisplayName": "Value",
"value": 8928.91
}
]
},
{
"dimension": 2,
"dimensionDisplayName": "Metric inputs",
"item": 2,
"itemDisplayName": "Marketing expense",
"measures": [
{
"index": 2,
"measureDisplayName": "Value",
"value": 740.11
}
]
}
]
}
]
}
]
}

Was this page useful?
❤️
👍
🤔
👎
😭