🚀 DAY 4 OF LAUNCH WEEK:Introducing Socket Scanning for OpenVSX Extensions.Learn more →
Socket
Book a DemoInstallSign in
Socket

@coveops/add-meta-analytics

Package Overview
Dependencies
Maintainers
12
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@coveops/add-meta-analytics

Add additional Analytics metadata based upon metadata from the current result

latest
npmnpm
Version
1.0.0
Version published
Weekly downloads
6
50%
Maintainers
12
Weekly downloads
 
Created
Source

add-meta-analytics

Add additional Analytics metadata based upon metadata from the current result. For example: you want to sent the Author or Accountname to a custom analytics event for use in a ML model.

** Make sure that all the analyticsFields defined are created as Dimensions in your Coveo Cloud Organization. **

There are two components:

CoveoAddMetaAnalytics

To define the metadata and fields which you want to sent.

CoveoSendMetaAnalytics

This component will gather all the AddMetaAnalytics definitions and will send them to the Analytics.

** So without CoveoSendMetaAnalytics nothing will happen!!! **

Disclaimer: This component was built by the community at large and is not an official Coveo JSUI Component. Use this component at your own risk.

Getting Started

  • Install the component into your project.
npm i @coveops/add-meta-analytics
  • Use the Component or extend it

Typescript:

import { AddMetaAnalytics, IAddMetaAnalyticsOptions } from '@coveops/add-meta-analytics';
import { SendMetaAnalytics, ISendMetaAnalyticsOptions } from '@coveops/add-meta-analytics';

Javascript

const add-meta-analytics = require('@coveops/add-meta-analytics').AddMetaAnalytics;
const send-meta-analytics = require('@coveops/add-meta-analytics').SendMetaAnalytics;
  • You can also expose the component alongside other components being built in your project.
export * from '@coveops/add-meta-analytics'
  • Include the component in your template as follows:

Place the component after your CoveoSearchInterface

<div
    class="CoveoAddMetaAnalytics"
    data-result-field="jifieldsprojectname"
    data-result-field-uri=""
    data-analytics-field="c_wpprojectname"
  ></div>
<div
    class="CoveoAddMetaAnalytics"
    data-result-field="displayname"
    data-check-field="worktitle"
    data-use-parent="false"
    data-analytics-field="c_wpauthordisplay"
  ></div>
<div class="CoveoSendMetaAnalytics"></div>

Options

CoveoAddMetaAnalytics

The following options can be configured:

OptionRequiredTypeDefaultNotes
checkFieldNostring This field must exists on the result, if it does not, nothing will be send. Use this when you want to sent a resultField with a condition.
resultFieldYesstring Which field to use from the result, if the field is empty it will not be send
resultFieldUriNostring Which field to use from the result for a possible URI. If this one is present the analyticsfield will get Uri added. (Like c_wpauthordisplayUri)
useParentNobooleanfalseWhether to use the parents to find the folder.
analyticsFieldYesstring Dimension to use to store the value. Must exists!!!

CoveoSendMetaAnalytics

The following options can be configured:

OptionRequiredTypeDefaultNotes
nameNostringWorkplaceName to use for the Custom Event

Contribute

  • Clone the project
  • Copy .env.dist to .env and update the COVEO_ORG_ID and COVEO_TOKEN fields in the .env file to use your Coveo credentials and SERVER_PORT to configure the port of the sandbox - it will use 8080 by default.
  • Build the code base: npm run build
  • Serve the sandbox for live development npm run serve

FAQs

Package last updated on 22 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts