2017 © Pedro PelÃĄez
 

symfony-bundle external-tracking-bundle

Symfony2 bundle for manage external tracking scripts/pixel trackers.

image

geekyhouse/external-tracking-bundle

Symfony2 bundle for manage external tracking scripts/pixel trackers.

  • Tuesday, November 17, 2015
  • by geekyhouse
  • Repository
  • 1 Watchers
  • 2 Stars
  • 9,641 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 10 Versions
  • 0 % Grown

The README.md

ExternalTrackingBundle

Symfony2 bundle for manage external tracking scripts/pixel trackers., (*1)

Build Status Latest Stable Version Total Downloads Latest Unstable Version License Dependency Status, (*2)

knpbundles.com, (*3)

Introduction

This bundle allows you to manage pixeltrackers / script trackers your partners without interfering with user navigation :, (*4)

  • Trackers can be managed from one or more classes, and are added via an event handler.
  • The display of trackers can be pushed after the page loads, or even with a timer
  • No more dependence to any JavaScript framework ;)

Installation

Composer

Add to composer.json in your project to require section:, (*5)

...
    {
        "geekyhouse/external-tracking-bundle": "dev-master"
    }
...

Run command: php composer.phar install, (*6)

Add this bundle to your application's kernel

``` php //app/AppKernel.php public function registerBundles() { return array( // ... new GeekyHouse\ExternalTrackingBundle\ExternalTrackingBundle(), // ... ); }, (*7)


### ConīŦgure service in your YAML conīŦguration You can overwrite bundle classes. Default values : ```` # app/conīŦg/conīŦg.yml external_tracking: manager_class: GeekyHouse\ExternalTrackingBundle\Service\ExternalTrackingManager request_listener_class: GeekyHouse\ExternalTrackingBundle\EventListener\RequestListener extension_class: GeekyHouse\ExternalTrackingBundle\Twig\Extension\ExternalTrackingExtension ```` ### Custom events listeners This bundle provides 2 events dispatchers that you can use : * `geekyhouse.event.before_get_trackers` : Called first when "getTrackers" is called * `geekyhouse.event.after_get_trackers` : Called juste before return when "getTrackers" is called You can easily create a custom service which add datas just before writing trackers, like this : ```` # app/conīŦg/conīŦg.yml services: my.custom.listener: class: My\Bundle\EventListener\CustomListener tags: - { name: kernel.event_listener, event: geekyhouse.event.before_get_trackers, method: beforeGetTrackers } - { name: kernel.event_listener, event: geekyhouse.event.after_get_trackers, method: afterGetTrackers } arguments: [@service_container] ```` ``` 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) { } }

In this example, we just add custom user datas on ExternalTrackingManager systematically., (*8)

Twig Extension

A Twig extension is given by default : GeekyHouse\ExternalTrackingBundle\Twig\Extension, (*9)

It provides the function get_external_trackers which write your trackers on a page., (*10)

This function takes 2 arguments : * onDocumentReady (default TRUE) If TRUE, wait the DOM loading before writing the trackers. * timer (default 500) The time in milliseconds to wait before writing the trackers (after DOM loading if TRUE)., (*11)

Use this function on a Twig template like this :, (*12)

# base.html.twig
[...]
    {{ get_external_trackers(true, 500)|raw }}
[...]

Don't forget the |raw, or Twig will escape the JavaScript tags., (*13)

It's recomended to write this line at the end of the page., (*14)

This extension contains a private method, cleanJavascriptString, whose purpose is to convert PHP string into evaluable JavaScript string. This method is in bÃĒta test currently, please tell us if you have some problem with it :), (*15)

The Versions

17/11 2015

dev-master

9999999-dev https://github.com/GeekyHouse/ExternalTrackingBundle

Symfony2 bundle for manage external tracking scripts/pixel trackers.

  Sources   Download

LGPL-3.0+

The Requires

 

The Development Requires

by Damien Jarry

symfony tracking external tracking tracker manager

17/11 2015

1.3.8

1.3.8.0 https://github.com/GeekyHouse/ExternalTrackingBundle

Symfony2 bundle for manage external tracking scripts/pixel trackers.

  Sources   Download

LGPL-3.0+

The Requires

 

The Development Requires

by Damien Jarry

symfony tracking external tracking tracker manager

17/11 2015

1.3.7

1.3.7.0 https://github.com/GeekyHouse/ExternalTrackingBundle

Symfony2 bundle for manage external tracking scripts/pixel trackers.

  Sources   Download

LGPL-3.0+

The Requires

 

The Development Requires

by Damien Jarry

symfony tracking external tracking tracker manager

16/11 2015

1.3.6

1.3.6.0 https://github.com/GeekyHouse/ExternalTrackingBundle

Symfony2 bundle for manage external tracking scripts/pixel trackers.

  Sources   Download

LGPL-3.0+

The Requires

 

The Development Requires

by Damien Jarry

symfony tracking external tracking tracker manager

08/07 2015

1.3.4

1.3.4.0 https://github.com/GeekyHouse/ExternalTrackingBundle

Symfony2 bundle for manage external tracking scripts/pixel trackers.

  Sources   Download

LGPL-3.0+

The Requires

 

The Development Requires

by Damien Jarry

symfony tracking external tracking tracker manager

12/06 2014

1.3.3

1.3.3.0 https://github.com/GeekyHouse/ExternalTrackingBundle

Symfony2 bundle for manage external tracking scripts/pixel trackers.

  Sources   Download

LGPL-3.0+

The Requires

 

The Development Requires

by Damien Jarry

symfony tracking external tracking tracker manager

06/06 2014

1.3.2

1.3.2.0 https://github.com/GeekyHouse/ExternalTrackingBundle

Symfony2 bundle for manage external tracking scripts/pixel trackers.

  Sources   Download

LGPL-3.0+

The Requires

 

The Development Requires

by Damien Jarry

symfony tracking external tracking tracker manager

04/06 2014

1.3.1

1.3.1.0 https://github.com/GeekyHouse/ExternalTrackingBundle

Symfony2 bundle for manage external tracking scripts/pixel trackers.

  Sources   Download

LGPL-3.0+

The Requires

 

The Development Requires

by Damien Jarry

symfony tracking external tracking tracker manager

04/06 2014

1.3.0

1.3.0.0 https://github.com/GeekyHouse/ExternalTrackingBundle

Symfony2 bundle for manage external tracking scripts/pixel trackers.

  Sources   Download

LGPL-3.0+

The Requires

 

The Development Requires

by Damien Jarry

symfony tracking external tracking tracker manager

30/05 2014

1.2.1

1.2.1.0 https://github.com/GeekyHouse/ExternalTrackingBundle

Symfony2 bundle for manage external tracking scripts/pixel trackers.

  Sources   Download

LGPL-3.0+

The Requires

 

The Development Requires

by Damien Jarry

symfony tracking external tracking tracker manager