Configure a Component for CRM Analytics Dashboards

Implement custom functionality using Lightning web components and then use them interactively with CRM Analytics dashboard widgets and steps.

1. Add the CRM Analytics Target in the Configuration File 

The componentName.js-meta.xml file defines the metadata values for the component, including the setting to allow usage in a CRM Analytics dashboard. Add the analytics__Dashboard target to the component’s configuration file. Ensure that the isExposed attribute is set to true so the component is visible to the CRM Analytics designer UI.

<?xml version="1.0" encoding="UTF-8"?> <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> <isExposed>true</isExposed> <targets> <target>analytics__Dashboard</target> </targets> </LightningComponentBundle>

2. Set Component Configuration Options 

In the componentName.js-meta.xml file, add a targetConfig for the analytics__Dashboard target. Set the hasStep tag to true if the component is designed to use CRM Analytics query data from a dashboard step. For each component attribute that is designed to be used by a CRM Analytics dashboard, add property tag.

<?xml version="1.0" encoding="UTF-8"?> <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> <targetConfig targets="analytics__Dashboard"> <hasStep>true</hasStep> <property name="title" type="String" label="Title" description="Component Title" required="true" /> </targetConfig> </LightningComponentBundle>

In addition to the common data types, the analytics__Dashboard target also supports Measure and Dimension data types for components with <hasStep>true</hasStep>. The dashboard editor is able to choose a column of the given data type from the results of the attached step.

<?xml version="1.0" encoding="UTF-8"?> <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> <targetConfig targets="analytics__Dashboard"> <hasStep>true</hasStep> <property name="labelColumn" type="Dimension" label="Label Column" description="Segment Label" required="true" /> </targetConfig> </LightningComponentBundle>

After completing these steps, add your Lightning web component as a component widget in the CRM Analytics Studio dashboard editor. For more information, see the Lightning Web Components in CRM Analytics Dashboards developer guide.

The Summer '25 guide is now live

Looking for the Component Reference? Go to https://developer.salesforce.com/docs/component-library/.