PHP code example of geekyhouse / external-tracking-bundle

1. Go to this page and download the library: Download geekyhouse/external-tracking-bundle 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/ */

    

geekyhouse / external-tracking-bundle example snippets

 php
//app/AppKernel.php
public function registerBundles()
{
    return array(
         // ...
        new GeekyHouse\ExternalTrackingBundle\ExternalTrackingBundle(),
        // ...
    );
}
 php
// My/Bundle/EventListener/CustomListener.php
namespace My\Bundle\EventListener;

use GeekyHouse\ExternalTrackingBundle\Event\ExternalTrackingEvent;

class CustomListener
{

    private $container;

    public function __construct($container)
    {
        $this->container = $container;
    }

    public function beforeGetTrackers(ExternalTrackingEvent $event)
    {
        $UserManager = $this->container->get('my.user.manager');
        $this->ExternalTrackingManager->pushData(
            array(
                'user' => $UserManager->getCurrentUser()
            )
        );
    }

    public function afterGetTrackers(ExternalTrackingEvent $event)
    {
    }

}