The UtmCookieBundle allow you to save utm parameters from url into a cookie. It's also provide a bunch of tools to easily retrive all or each utm.
- Work with any flex Symfony projects 3.4+ to 5.0+
- PHP v7.1+
Download tattali/utm-cookie-bundle
using composer
$ composer require tattali/utm-cookie-bundle
<?php
use UtmCookieBundle\UtmCookie\UtmCookie;
class ExampleHandler
{
private $utmCookie;
public function __construct(UtmCookie $utmCookie) {
$this->utmCookie = $utmCookie;
}
public function example()
{
$this->utmCookie->get(); // get all utm cookies as array
$this->utmCookie->get('utm_source'); // get utm_source
$this->utmCookie->get('source'); // get utm_source
}
}
To go further check the official documentation of the bundle, at UtmCookieBundle.