You are here

public static function OfficialFacebookPixelInjection::injectPixelCode in Official Facebook Pixel 8

Same name and namespace in other branches
  1. 7 src/OfficialFacebookPixelInjection.php \Drupal\official_facebook_pixel\OfficialFacebookPixelInjection::injectPixelCode()
1 call to OfficialFacebookPixelInjection::injectPixelCode()
official_facebook_pixel_page_attachments in ./official_facebook_pixel.module
Implements hook_page_attachments().

File

src/OfficialFacebookPixelInjection.php, line 32
Contains \Drupal\official_facebook_pixel \OfficialFacebookPixelInjection.

Class

OfficialFacebookPixelInjection
Class OfficialFacebookPixelInjection.

Namespace

Drupal\official_facebook_pixel

Code

public static function injectPixelCode(array &$page) {
  $options = OfficialFacebookPixelOptions::getInstance();
  PixelScriptBuilder::initialize($options
    ->getPixelId());
  self::injectScriptCode($page, $options);
  self::injectNoScriptCode($page);
  foreach (OfficialFacebookPixelConfig::integrationConfigFor8() as $key => $value) {
    $class_name = 'Drupal\\official_facebook_pixel\\integration\\' . $value;
    $class_name::injectPixelCode($page);
  }
}