---
schema_version: "1"
id: 7badcaf55c175c66cd3918bdb02c099b3acc47a9aada475b485bc4e0881d38c1
title: setAnalyticsEnabled
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud-mobilepush/engagement_sdk/references/cordova/setAnalyticsEnabled.md
canonical_url: https://developer.salesforce.com/docs/marketing/mobile-unified-sdk/references/engagement-mobile-sdk-reference/setAnalyticsEnabled.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: e6e69f0b012e9848e1007aee7078657d8afd6536c26e0ba229fbfbc167f8d867
products:
  - Salesforce Engagement SDK
---
# setAnalyticsEnabled

Enables or disables analytics in the native MobilePush SDK.

## Syntax

`MCCordovaPlugin.setAnalyticsEnabled(enabled, [successCallback], [errorCallback])`

## Kind

Static method of `MCCordovaPlugin`.

## Parameters

| Parameter         | Type       | Description                 |
| ----------------- | ---------- | --------------------------- |
| `enabled`         | `boolean`  | Whether to enable analytics |
| `successCallback` | `function` |                             |
| `errorCallback`   | `function` |                             |
