You are here

function facebook_tracking_pixel_events_reserved in Facebook Tracking Pixel 7

Same name and namespace in other branches
  1. 8 facebook_tracking_pixel.module \facebook_tracking_pixel_events_reserved()

Returns the events reserved for this module.

Return value

array

3 calls to facebook_tracking_pixel_events_reserved()
facebook_tracking_pixel_commerce_form_submit in ./facebook_tracking_pixel.admin.commerce.inc
Submit handler for commerce tracking admin form.
facebook_tracking_pixel_page_build in ./facebook_tracking_pixel.module
Implements hook_page_build().
facebook_tracking_pixel_user_registration_submit in ./facebook_tracking_pixel.admin.inc
Submit handler for user registration admin form.

File

./facebook_tracking_pixel.module, line 445
facebook_tracking_pixel.module Facebook Tracking Module.

Code

function facebook_tracking_pixel_events_reserved() {
  $events = [];
  $events['ftpregistration'] = [
    'name' => t('Complete Registration'),
    'code' => 'fbq(\'track\', \'CompleteRegistration\');',
  ];
  $events['ftpdcinitiatecheckout'] = [
    'name' => t('Initiate checkout'),
    'code' => 'fbq(\'track\', \'InitiateCheckout\');',
  ];
  $events['ftpdcaddtocart'] = [
    'name' => t('Add to Cart'),
    'code' => 'fbq(\'track\', \'AddToCart\', {contents: [{"id":@id, "quantity":@quantity}], content_type: \'product\', value: \'@val\', currency: \'@cur\'});',
  ];
  $events['ftpdcpurchase'] = [
    'name' => t('Make Purchase'),
    'code' => 'fbq(\'track\', \'Purchase\', {contents: [@contents], content_type: \'product\', value: \'@val\', currency: \'@cur\'});',
  ];
  return $events;
}