Download wp-calypso/client/lib/analytics/ad-tracking/track-custom-events.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.15 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/lib/analytics/ad-tracking/track-custom-events.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/lib/analytics/ad-tracking/track-custom-events.js
-
curl -L -o track-custom-events.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/lib/analytics/ad-tracking/track-custom-events.js
1.15 kB
| import { debug, TRACKING_IDS } from './constants'; | |
| // Ensure setup has run. | |
| import './setup'; | |
| /** | |
| * Fire custom facebook conversion tracking event. | |
| * @param {string} name - The name of the custom event. | |
| * @param {Object} properties - The custom event attributes. | |
| * @returns {void} | |
| */ | |
| export function trackCustomFacebookConversionEvent( name, properties ) { | |
| window.fbq && window.fbq( 'trackSingleCustom', TRACKING_IDS.facebookInit, name, properties ); | |
| } | |
| /** | |
| * Fire custom adwords conversation tracking event. | |
| * @param {Object} properties - The custom event attributes. | |
| * @returns {void} | |
| */ | |
| export function trackCustomAdWordsRemarketingEvent( properties ) { | |
| debug( 'trackCustomAdWordsRemarketingEvent:', properties ); | |
| // Not sure this is currently serving any purpose and whether we can convert it to use Gtag. | |
| // Refactoring the middleware for analytics is outside the scope of this PR so I'll leave the function stub for now. | |
| /* | |
| window.google_trackConversion && | |
| window.google_trackConversion( { | |
| google_conversion_id: ADWORDS_CONVERSION_ID, | |
| google_custom_params: properties, | |
| google_remarketing_only: true, | |
| } ); | |
| */ | |
| } | |