# Analytics Providers: Marfeel Environment
Analytics Providers receive the Marfeel environment
object in the constructor and all trigger methods
Marfeel environment is decorated with specific fields for each provider: this article is about the analytics providers' specificities.
Use Marfeel Environment utilities to:
- Install scrips
- Retrieve context information from Marfeel. e.g: navigation level, uri, etc.
- Retrieve tenant information from Marfeel
# Common fields
All the fields described in this section are common to all providers. You can read more in the Environment implementation (opens new window).
# consent
The field consent
exposes 2 methods:
getGoogleConsent
getVendorConsent
To retrieve all the information regarding consent from a tenant.
# location
The field location
exposes all the properties of the current location of a session:
environment
: the Marfeel garda run time environment. Equivalent to the legacyGardaMarfeel.getRuntimeEnvinroment()
method.title
: the current page titlelevel
: the current navigation level. e.g:mosaic
,gallery
,details
hostname
: the current hostnamehref
: the current hrefsearch
: the current query parameters of the pagehash
: the current hash of the pagepathname
: the pathname of the pageorigin
: the current origin of the pageprotocol
: the current protocol of the pagereferrer
: the referrer of the pagegetSection
: a function that returns the current section.
Prefer Marfeel Environment
Prefer using Marfeel Environment to using the window
object for page information.
# scripts
The field scripts
exposes 2 helper methods to install scrips:
installScript
: Replaces the legacyloadExternalScript
method that is used in the legacy metrics.installScriptInNode
# tenant
The field tenant
exposes an id
which is the publisher's id, like www.example.com
# Analytics-specific fields
In addition to the common fields, a device
object is available.
# device
The field device
exposes the Marfeel device environment, for example, marfeel_browser
.
Read the implementation (opens new window) for more details.