# jetpack/16.3/jetpack_vendor/automattic/woocommerce-analytics/src/class-consent-manager.php

Jetpack – WP Security, Backup, Speed, &amp; Growth, version 16.3. 34 lines.

- Page: https://pluginprobe.com/plugins/jetpack/16.3/code/jetpack_vendor/automattic/woocommerce-analytics/src/class-consent-manager.php
- Raw: https://pluginprobe.com/plugins/jetpack/16.3/raw/jetpack_vendor/automattic/woocommerce-analytics/src/class-consent-manager.php
- Modified: 2025-11-24T17:00:32+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/jetpack/16.3/code/jetpack_vendor/automattic/woocommerce-analytics/src/class-consent-manager.php#L10-L20`.

```php
<?php
/**
 * Consent management for WP Consent API integration
 *
 * @package automattic/woocommerce-analytics
 */

namespace Automattic\Woocommerce_Analytics;

/**
 * Manages consent checking for WooCommerce Analytics
 */
class Consent_Manager {

	/**
	 * WP Consent API's consent type we check for analytics tracking
	 */
	const WP_CONSENT_API_STATISTICS_TYPE = 'statistics';

	/**
	 * Check if user has consent for analytics tracking
	 *
	 * @return bool
	 */
	public static function has_analytics_consent() {
		if ( ! function_exists( 'wp_has_consent' ) ) {
			// If WP Consent API is not available, default to true for backward compatibility
			return true;
		}

		return \wp_has_consent( self::WP_CONSENT_API_STATISTICS_TYPE );
	}
}

```
