Download the PHP package geekyhouse/external-tracking-bundle without Composer
On this page you can find all versions of the php package geekyhouse/external-tracking-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download geekyhouse/external-tracking-bundle
More information about geekyhouse/external-tracking-bundle
Files in geekyhouse/external-tracking-bundle
Package external-tracking-bundle
Short Description Symfony2 bundle for manage external tracking scripts/pixel trackers.
License LGPL-3.0+
Homepage https://github.com/GeekyHouse/ExternalTrackingBundle
Informations about the package external-tracking-bundle
ExternalTrackingBundle
Symfony2 bundle for manage external tracking scripts/pixel trackers.
Introduction
This bundle allows you to manage pixeltrackers / script trackers your partners without interfering with user navigation :
- 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:
`
Run command:
php composer.phar install
Add this bundle to your application's kernel
Configure service in your YAML configuration
You can overwrite bundle classes. Default values : `
Custom events listeners
This bundle provides 2 events dispatchers that you can use :
geekyhouse.event.before_get_trackers
: Called first when "getTrackers" is calledgeekyhouse.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 : `
In this example, we just add custom user datas on ExternalTrackingManager systematically.
Twig Extension
A Twig extension is given by default : GeekyHouse\ExternalTrackingBundle\Twig\Extension
It provides the function get_external_trackers
which write your trackers on a page.
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).
Use this function on a Twig template like this :
Don't forget the |raw
, or Twig will escape the JavaScript tags.
It's recomended to write this line at the end of the page.
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 :)
All versions of external-tracking-bundle with dependencies
symfony/symfony Version >=2.1,<3.0
twig/extensions Version >=1.0
symfony/assetic-bundle Version >=2.3
sensio/framework-extra-bundle Version >= 2.1