2017 © Pedro Peláez
 

library utm-cookie

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.

image

xsuchy09/utm-cookie

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.

  • Wednesday, July 11, 2018
  • by xsuchy09
  • Repository
  • 1 Watchers
  • 4 Stars
  • 1,757 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 11 Versions
  • 48 % Grown

The README.md

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., (*1)

Authors: - Petr Suchy (xsuchy09 - www.wamos.cz), (*2)

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., (*3)

It handles utm parameters: - utm_campaign - utm_medium - utm_source - utm_term - utm_content, (*4)

You can get them with original name or wihout "utm_" (for example just "source" for "utm_source" - you can use both) - see examples., (*5)

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)., (*6)

Installation (via composer)

Get composer and add this in your requires section of the composer.json:, (*7)

{
    "require": {
        "xsuchy09/utm-cookie": "*"
    }
}

and then, (*8)

composer install

Usage

Basic Example

UtmCookie::init(); // just init - read utm params and cookie and save new values (is auto called by first call of UtmCookie::get method)
UtmCookie::get(); // get all utm cookies as array
UtmCookie::getObject(); // get all utm cookies as object (stdClass)
UtmCookie::get('utm_source'); // get utm_source
UtmCookie::get('source'); // get utm_source
$dateInterval = DateInterval::createFromDateString('7 days');
UtmCookie::setLifetime($dateInterval);
UtmCookie::setName('utm');

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)., (*9)

UtmCookie::setOverwrite(false);

More examples can be found in the examples/ directory., (*10)

The Versions

11/07 2018

dev-master

9999999-dev https://github.com/xsuchy09/utm-cookie

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.

  Sources   Download

Apache-2.0

The Requires

  • php >=7.1

 

analytics cookie utm

11/07 2018

2.0.0

2.0.0.0 https://github.com/xsuchy09/utm-cookie

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.

  Sources   Download

Apache-2.0

The Requires

  • php >=7.1

 

analytics cookie utm

11/07 2018

1.0.6

1.0.6.0 https://github.com/xsuchy09/utm-cookie

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.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4

 

analytics cookie utm

12/01 2018

1.0.5

1.0.5.0 https://github.com/xsuchy09/utm-cookie

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.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4

 

analytics cookie utm

12/08 2016

1.0.4

1.0.4.0 https://github.com/xsuchy09/utm-cookie

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.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4

 

analytics cookie utm

30/06 2016

1.0.3

1.0.3.0 https://github.com/xsuchy09/utm-cookie

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.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4

 

analytics cookie utm

30/06 2016

1.0.2

1.0.2.0 https://github.com/xsuchy09/utm-cookie

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.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4

 

analytics cookie utm

06/06 2016

1.0.1

1.0.1.0 https://github.com/xsuchy09/utm-cookie

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.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4

 

analytics cookie utm

06/06 2016

1.0.0

1.0.0.0 https://github.com/xsuchy09/utm-cookie

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.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4

 

analytics cookie utm

06/06 2016

0.0.2

0.0.2.0 https://github.com/xsuchy09/utm-cookie

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.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4 || >=7.0

 

analytics cookie utm

06/06 2016

0.0.1

0.0.1.0 https://github.com/xsuchy09/utm-cookie

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.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4 || >=7.0

 

analytics cookie utm