dev-master
9999999-dev http://stfalcon.comSymfony AtfalconAbTestBundle
MIT
The Requires
- php >=5.3.2
- symfony/symfony >=2.1
- sonata-project/admin-bundle ~2.1
- sonata-project/doctrine-orm-admin-bundle ~2.2
analytics google analytics ab test stfalcon
Wallogit.com
2017 © Pedro Peláez
Symfony AtfalconAbTestBundle
Simple small bundle for add Google analytics A/B test code on site pages, (*1)
This version of the bundle requires:, (*2)
Installation is a quick 4 step process:, (*3)
{
"require": {
"stfalcon-studio/ab-test-bundle": "*"
}
}
Now tell composer to download the bundle by running the command:, (*4)
``` bash $ php composer.phar update stfalcon-studio/ab-test-bundle, (*5)
Composer will install the bundle to your project's `vendor/stfalcon` directory. ### Step 2: Enable the StfalconAbTestBundle and requiremented bundles Finally, enable the bundle in the kernel: ``` php <?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... // For SonataAdminBundle new Sonata\CoreBundle\SonataCoreBundle(), new Sonata\BlockBundle\SonataBlockBundle(), new Knp\Bundle\MenuBundle\KnpMenuBundle(), new Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle(), new Sonata\AdminBundle\SonataAdminBundle(), new Stfalcon\AbTestBundle\StfalconAbTestBundle(), // ... ); }
Now that the bundle is configured, the last thing you need to do is update your
database schema because you have added a new entity the AbTest., (*6)
Run the following command., (*7)
``` bash $ php app/console doctrine:schema:update --force, (*8)
At this point you can already access the admin dashboard by visiting the url: http://yoursite.local/admin/dashboard. [Getting started with SonataAdminBundle](http://sonata-project.org/bundles/admin/2-0/doc/reference/getting_started.html) ### Step 4: Add code in template For add Google Analytics A/B test code in your pages you must add following code after `<head>` tag in your main template. ``` twig {{ init_ab_test() }}
For add AbTest fill the form in admin part of site with:, (*9)
Page Url - url of page where you want add A/B test code in header. Example: /page/some-page-slug, (*10)
Code - Code of Google analytics A/B test. Example: 12345-6, (*11)
And now if you'll open http://your-project/page/some-page-slug in HTML code of page will be added code for Google analytics A/B test, (*12)
Now that you have completed the installation and configuration of the StfalconAbTestBundle!, (*13)
Symfony AtfalconAbTestBundle
MIT
analytics google analytics ab test stfalcon