PHP code example of tattali / utm-cookie-bundle
1. Go to this page and download the library: Download tattali/utm-cookie-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/ */
tattali / utm-cookie-bundle example snippets
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();
$this->utmCookie->get('utm_campaign'); // or whithout 'utm_' prefix
$this->utmCookie->get('utm_content');
$this->utmCookie->get('utm_medium');
$this->utmCookie->get('utm_source');
$this->utmCookie->get('utm_term');
$this->utmCookie->init(); // Init and read utm params and cookie and save new values.