You are here

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

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

File

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

Class

OfficialFacebookPixelInjection
Class OfficialFacebookPixelInjection.

Namespace

Drupal\official_facebook_pixel

Code

public static function injectNoScriptCode(array &$page) {

  // Inject inline noscript code to head
  $pixel_noscript_code = PixelScriptBuilder::getPixelNoscriptCode();
  $page['#attached']['html_head'][] = [
    [
      '#tag' => 'noscript',
      '#value' => $pixel_noscript_code,
    ],
    'facebook_pixel_noscript_code',
  ];
}