nattreid / facebook-pixel
Facebook Pixel for Nette Framework
3.0.7
2021-07-23 07:56 UTC
Requires
- php: >= 7.1
- facebook/php-ads-sdk: ~10.0.1
- nette/application: ~2.4
- nette/di: ~2.4
Requires (Dev)
- nattreid/form: ~1.0
- nattreid/web-manager: ~1.0
- nette/tester: ~1.7
- tracy/tracy: ~2.4
README
Nastavení v config.neon
extensions: facebookPixel: NAtrreid\FacebookPixel\DI\FacebookPixelExtension facebookPixel: credentials: - [pixelId, accessToken] - [pixelId, accessToken]
Použití
/** @var NAttreid\FacebookPixel\IFacebookPixelFactory @inject */ public $facebookPixelFactory; protected function createComponentFacebookPixel() { return $this->facebookPixelFactory->create(); } public function someRender(){ $this['facebookPixel']->search(); // vyhledavani $this['facebookPixel']->viewContent(); // detail $this['facebookPixel']->addToCart(); // pridani do kosiku $this['facebookPixel']->addToWishList(); // pridani do prani $this['facebookPixel']->initiateCheckout(); // prechod k zaplaceni nakupu $this['facebookPixel']->addPaymentInfo(); // pridani platebnich udaju $this['facebookPixel']->purchase() // provedeni nakupu ->setValue(5) ->setCurrency('EUR'); $this['facebookPixel']->lead(); // potencialni zakaznik $this['facebookPixel']->completeRegistration(); // dokonceni registrace }
v latte
<html> <head> <!-- html kod --> {control facebookPixel} </head> <body> {control facebookPixel:ajax} <!-- html kod --> </body> </html>