Done !
| Server IP : 46.105.57.169 / Your IP : 216.73.216.67 Web Server : Apache System : Linux webm002.cluster120.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64 User : verseaumee ( 152031) PHP Version : 8.5.7 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/verseaumee/maze/wp-content/plugins/snapchat-for-woocommerce/js/src/utils/ |
Upload File : |
/**
* External dependencies
*/
import { select } from '@wordpress/data';
import { noop } from 'lodash';
import { recordEvent, queueRecordEvent } from '@woocommerce/tracks';
/**
* Internal dependencies
*/
import { sfwData } from '~/constants';
import { STORE_KEY } from '~/data';
export const recordStepperChangeEvent = noop;
export const recordStepContinueEvent = noop;
/**
* Returns an event properties with base properties.
* - gla_version: Plugin version
* - gla_mc_id: Google Merchant Center account ID if connected
* - gla_ads_id: Google Ads account ID if connected
*
* @param {Object} [eventProperties] The event properties to be included base properties.
* @return {Object} Event properties with base event properties.
*/
export function addBaseEventProperties( eventProperties ) {
const { slug } = sfwData;
const { version, adAccountId } = select( STORE_KEY ).getGeneral();
const mixedProperties = {
...eventProperties,
[ `${ slug }_version` ]: version,
};
if ( adAccountId ) {
mixedProperties[ `${ slug }_ads_id` ] = adAccountId;
}
return mixedProperties;
}
/**
* Record a tracking event with base properties.
*
* @param {string} eventName The name of the event to record.
* @param {Object} [eventProperties] The event properties to include in the event.
*/
export function recordSfwEvent( eventName, eventProperties ) {
recordEvent( eventName, addBaseEventProperties( eventProperties ) );
}
/**
* Queue a tracking event with base properties.
*
* This allows you to delay tracking events that would otherwise cause a race condition.
*
* @param {string} eventName The name of the event to record.
* @param {Object} [eventProperties] The event properties to include in the event.
*/
export function queueRecordSfwEvent( eventName, eventProperties ) {
queueRecordEvent( eventName, addBaseEventProperties( eventProperties ) );
}