# woocommerce-pos/1.10.16/includes/Admin/Analytics.php

WCPOS – Point of Sale (POS) plugin for WooCommerce, version 1.10.16. 64 lines.

- Page: https://pluginprobe.com/plugins/woocommerce-pos/1.10.16/code/includes/Admin/Analytics.php
- Raw: https://pluginprobe.com/plugins/woocommerce-pos/1.10.16/raw/includes/Admin/Analytics.php
- Modified: 2026-05-15T18:12:48+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/woocommerce-pos/1.10.16/code/includes/Admin/Analytics.php#L10-L20`.

```php
<?php
/**
 * Analytics.
 *
 * @package WCPOS\WooCommercePOS
 */

namespace WCPOS\WooCommercePOS\Admin;

use const WCPOS\WooCommercePOS\PLUGIN_NAME;
use const WCPOS\WooCommercePOS\PLUGIN_URL;
use const WCPOS\WooCommercePOS\TRANSLATION_VERSION;
use const WCPOS\WooCommercePOS\VERSION;

/**
 * Analytics class.
 */
class Analytics {

	/**
	 * Constructor.
	 */
	public function __construct() {
		add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_assets' ) );
		add_action( 'admin_head', array( $this, 'analytics_css' ) );
	}

	/**
	 * Add CSS to the admin head
	 */
	public function analytics_css() {
		echo '<style>.woocommerce-pos-upgrade-notice { margin: 0 0 24px 0; }</style>';
	}

	/**
	 * Enqueue analytics assets.
	 */
	public function enqueue_assets() {
		$is_development = isset( $_ENV['DEVELOPMENT'] )
			&& wp_validate_boolean( sanitize_text_field( wp_unslash( $_ENV['DEVELOPMENT'] ) ) );
		$dir = $is_development ? 'build' : 'assets';

		// Inject translation version for i18next.
		wp_add_inline_script(
			'wp-hooks',
			'window.wcpos = window.wcpos || {}; window.wcpos.translationVersion = "' . esc_js( TRANSLATION_VERSION ) . '";',
			'before'
		);

		wp_enqueue_script(
			PLUGIN_NAME . '-analytics',
			PLUGIN_URL . $dir . '/js/analytics.js',
			array(
				'wp-hooks',
				'wc-components',
			),
			VERSION,
			true
		);

		wp_add_inline_script( PLUGIN_NAME . '-analytics', Menu::get_posthog_inline_script(), 'before' );
	}
}

```
