public function OfficialFacebookPixelOptions::setUserInfo in Official Facebook Pixel 7
Same name and namespace in other branches
- 8 src/OfficialFacebookPixelOptions.php \Drupal\official_facebook_pixel\OfficialFacebookPixelOptions::setUserInfo()
1 call to OfficialFacebookPixelOptions::setUserInfo()
File
- src/
OfficialFacebookPixelOptions.php, line 75 - Contains \Drupal\official_facebook_pixel \OfficialFacebookPixelOptions.
Class
- OfficialFacebookPixelOptions
- Class OfficialFacebookPixelOptions.
Namespace
Drupal\official_facebook_pixelCode
public function setUserInfo() {
global $user;
$use_pii = $this
->getUsePii();
if (0 === $user->uid || $use_pii !== 1) {
// User not logged in or admin chose not to send PII.
$this->userInfo = array();
}
else {
$this->userInfo = array_filter(array(
// Keys documented in
// https://developers.facebook.com/docs/facebook-pixel/pixel-with-ads/conversion-tracking#advanced_match
'em' => $user->mail,
), function ($value) {
return $value !== null && $value !== '';
});
}
}