API

FunnelConnect JavaScript API

The FunnelConnect JavaScript API is enclosed within Teavaro namespace that can be used in any JavaScript snippet after the fcTag.js was loaded successfully. It provides multiple functionalities that can be used to achieve specific goals or improve data and flow analysis.

getFcDataEntry

getFcDataEntry method provides access to data from the CDP for the client (browser). It accepts the following entry keys as a param: umid, attributes, identifiers, permissions, permissionsLastModification, notificationHistory and notificationStatus. In case of error, null value is returned and a descriptive error message is shown to the user via console.

Example usage:

Teavaro.API.getFcDataEntry('attributes')

Return types: string, object, key-value-pairs.

Return values (input based):

  • null for errors

  • umid: string e.g. c3641a83-3ae3-412f-b234-ea91cfaa3242

  • attributes: object e.g.

    {
      "deviceName": "PC",
      "isp": "ISP Services Ltd",
      "domainName": "any-isp-name.com",
      "browserType": "BR",
      "region": "England",
      "mobileBrand": "",
      "city": "London",
      "osFamily": "Windows",
      "browserFamily": "Chrome",
      "cc": "GB"
    }
    
  • identifiers: array e.g.

    [
      {
        "name": "fc_hemail",
        "value": "c98ba13fd5a342230e1e6c32d2bef7cc36d3125cce987ad3ecd5e6de3631dfea"
      },
      {
        "name": "fc_hcid",
        "value": "f6fa4edf58d07bb14de6f731eebc37e122a44c760bbc2e4ce982d106accbf791"
      }
    ]
    
  • permissions: object e.g.

    {
      "LI-NBA": true,
      "TransactionData": true,
      "LI-OPT": true,
      "CustomerData": true,
      "LI-OM": true
    }
    
  • permissionsLastModification: object e.g.

    {
      "LI-NBA": "2019-12-20T17:10:35.003Z",
      "TransactionData": "2020-09-18T11:51:00.684Z",
      "LI-OPT": "2019-12-20T17:10:35.003Z",
      "CustomerData": "2020-12-17T17:37:41.826Z",
      "LI-OM": "2020-04-21T13:30:58.064Z"
    }
    
  • notificationHistory: array e.g.

    [
        {
            "name": "APP",
            "version": 2,
            "permissions": [
            "LI-OM",
            "LI-OPT",
            "LI-NBA"
            ],
            "date": "2020-04-21T13:18:55.880Z"
        },
        {
            "name": "WEB",
            "version": 1,
            "permissions": [
            "LI-OM",
            "LI-OPT",
            "LI-NBA"
            ],
            "date": "2019-10-24T00:00:00Z"
        },
        ...
    ]
    
  • notificationStatus: object e.g.

    {
      "LI-OM": true,
      "LI-OPT": true,
      "LI-NBA": true
    }
    

setVerboseLoggingLevel

This method sets the logging level to verbose to enable extended logging. This logging level includes DEBUG and TRACK messages, granting more information that can be used to get specific information about any flow step or provide more information about an underlying issue. Logging level is saved to the browser’s local storage, so the extended logs will be enabled as long as the entry is in the local storage. It can be re-set to the default value by using resetLoggingLevel method explained below.

Example usage:

Teavaro.API.setVerboseLoggingLevel()

Return type: none

Return values: none

This method logs [FC_TAG]: [INFO] Verbose logging level has been set message, that indicates the logging level has been set successfully.

resetLoggingLevel

This method re-sets the logging level to the default from any other logging level by removing logging level local storage entry. Default logging level includes only ERROR, WARNING and INFO messages, which provides sufficient information about the operations that are happening as the flow progresses. This method does not need to be called to enable the default logging, as it is enabled as soon as the fcTag.js loads. It can be used to re-set the logging level set by setVerboseLoggingLevel.

Example usage:

Teavaro.API.resetLoggingLevel()

Return type: none

Return values: none

This method logs [FC_TAG]: [INFO] Logging level has been reset to info level message, that indicates the logging level has been set back to default successfully. If the verbose logging level was set beforehand, it could also show couple of other entries mentioning value of the current logging level, that is set in browser’s local storage.

getIdGraphEntry

This method grants access to IDs and data that is currently available from local storage’s ID graph when using the IDConnect cross-domain or Utiq telco identity resolution services. It accepts the following entry keys as a param: atid, mtid, fetchDate, umid, domain, ttl.

Example usage:

Teavaro.API.getIdGraphEntry('atid')

Return type: string

Return values:

  • string value of a data entry
  • ‘Entry key (string) parameter is missing’
  • ‘No FC configuration set up’
  • ‘No required IDC data present. Cannot extract the ID graph entry’
  • ‘Could not find an entry for provided entry name: {entryKey}’