Download the PHP package xsuchy09/utm-cookie without Composer
On this page you can find all versions of the php package xsuchy09/utm-cookie. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download xsuchy09/utm-cookie
More information about xsuchy09/utm-cookie
Files in xsuchy09/utm-cookie
Package utm-cookie
Short Description Utm-Cookie saves utm parameters from url into cookie with defined lifetime (default 7 days). Than cookie (utm) can be used later without parsing google or any other cookies.
License Apache-2.0
Homepage https://github.com/xsuchy09/utm-cookie
Informations about the package utm-cookie
UtmCookie
PHP library to save utm parameters from url into cookie for later use. PHP 7.1 is required for version 2.0.0+. If you need PHP 5.4+ compatibility use 1.0.6 version.
Authors:
- Petr Suchy (xsuchy09 - www.wamos.cz)
Overview
UtmCookie saves utm parameters from url into cookie with defined lifetime (default 7 days). Than cookie (utm) can be used later without parsing google or any other cookies.
It handles utm parameters:
- utm_campaign
- utm_medium
- utm_source
- utm_term
- utm_content
You can get them with original name or wihout "utm_" (for example just "source" for "utm_source" - you can use both) - see examples.
Since version 2.0.2 you can rewrite these cookies just with call UtmCookie::save($array)
where $array
should contains keys allowed by UtmCookie::$allowedUtmCookieKeys
(default are allowed utm parameters names).
Installation (via composer)
Get composer and add this in your requires section of the composer.json:
and then
Usage
Basic Example
Set lifetime of utm cookie
Set name of utm cookie
Set if overwrite all utm values even if only one detected.
Default TRUE. If set to false, utm value is overwite only if set (others will stay).
More examples can be found in the examples/ directory.