PHP code example of nattreid / facebook-pixel

1. Go to this page and download the library: Download nattreid/facebook-pixel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

nattreid / facebook-pixel example snippets


/** @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
}