Download wp-calypso/client/state/analytics/actions/record.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.18 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/analytics/actions/record.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/state/analytics/actions/record.js
-
curl -L -o record.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/analytics/actions/record.js
1.18 kB
| import { ANALYTICS_EVENT_RECORD, ANALYTICS_PAGE_VIEW_RECORD } from 'calypso/state/action-types'; | |
| export const recordEvent = ( service, args ) => ( { | |
| type: ANALYTICS_EVENT_RECORD, | |
| meta: { | |
| analytics: [ | |
| { | |
| type: ANALYTICS_EVENT_RECORD, | |
| payload: Object.assign( {}, { service }, args ), | |
| }, | |
| ], | |
| }, | |
| } ); | |
| export const recordGoogleEvent = ( category, action, label, value ) => | |
| recordEvent( 'ga', { category, action, label, value } ); | |
| export const recordTracksEvent = ( name, properties ) => | |
| recordEvent( 'tracks', { name, properties } ); | |
| export const recordCustomFacebookConversionEvent = ( name, properties ) => | |
| recordEvent( 'fb', { name, properties } ); | |
| export const recordCustomAdWordsRemarketingEvent = ( properties ) => | |
| recordEvent( 'adwords', { properties } ); | |
| export const recordPageView = ( url, title, service, properties = {}, options = {} ) => ( { | |
| type: ANALYTICS_PAGE_VIEW_RECORD, | |
| meta: { | |
| analytics: [ | |
| { | |
| type: ANALYTICS_PAGE_VIEW_RECORD, | |
| payload: { | |
| service, | |
| url, | |
| title, | |
| options, | |
| ...properties, | |
| }, | |
| }, | |
| ], | |
| }, | |
| } ); | |
| export const recordGooglePageView = ( url, title ) => recordPageView( url, title, 'ga' ); | |