public static function PixelScriptBuilder::getPixelNoscriptCode in Official Facebook Pixel 7
Same name and namespace in other branches
- 8 src/PixelScriptBuilder.php \Drupal\official_facebook_pixel\PixelScriptBuilder::getPixelNoscriptCode()
Gets FB pixel noscript code
1 call to PixelScriptBuilder::getPixelNoscriptCode()
File
- src/
PixelScriptBuilder.php, line 157 - Contains \Drupal\official_facebook_pixel\PixelScriptBuilder.
Class
- PixelScriptBuilder
- Pixel object
Namespace
Drupal\official_facebook_pixelCode
public static function getPixelNoscriptCode($event = 'PageView', $cd = array(), $tracking_name = '') {
if (empty(self::$pixelId)) {
return;
}
$data = '';
foreach ($cd as $k => $v) {
$data .= '&cd[' . $k . ']=' . $v;
}
if (!empty($tracking_name)) {
$data .= '&cd[' . self::FB_INTEGRATION_TRACKING_KEY . ']=' . $tracking_name;
}
return sprintf(self::$pixelNoscriptCode, self::$pixelId, $event, $data);
}