2017 © Pedro Peláez
 

library yii2-nox-referer-parser

Yii2 Referer Parser

image

nox-it/yii2-nox-referer-parser

Yii2 Referer Parser

  • Saturday, May 27, 2017
  • by jsas-development
  • Repository
  • 1 Watchers
  • 1 Stars
  • 142 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 8 Versions
  • 3 % Grown

The README.md

Yii PHP Framework Version 2 / NYX Referer Parser

NYX Referer Parser is a PHP library for extracting marketing attribution data (such as search terms) from referer URLs., (*1)

Latest Stable Version Total Downloads Latest Unstable Version License Monthly Downloads Daily Downloads composer.lock, (*2)

Installation

The preferred way to install this extension is through composer., (*3)

  • Either run
php composer.phar require --prefer-dist "nyx-solutions/yii2-nyx-referer-parser" "*"

or add, (*4)

"nyx-solutions/yii2-nyx-referer-parser": "*"

to the require section of your application's composer.json file., (*5)

Usage

In components (in the following example we get the RefererParser data and pass to the PublicAccessLog model, which in this case is just an example):, (*6)

namespace common\components\http;

use common\models\PublicAccessLog;

/**
 * Class RefererParser
 *
 * @package common\components\http
 */
class RefererParser extends \nyx\components\http\referer\RefererParser
{
    #region Constants
    const TYPE_GOOGLE_ORGANIC  = PublicAccessLog::TYPE_GOOGLE_ORGANIC;
    const TYPE_GOOGLE_ADS      = PublicAccessLog::TYPE_GOOGLE_ADS;
    const TYPE_GOOGLE_CAMPAIGN = PublicAccessLog::TYPE_GOOGLE_CAMPAIGN;
    const TYPE_EXTERNAL_SEARCH = PublicAccessLog::TYPE_EXTERNAL_SEARCH;
    const TYPE_EXTERNAL_SITE   = PublicAccessLog::TYPE_EXTERNAL_SITE;
    const TYPE_DIRECT          = PublicAccessLog::TYPE_DIRECT;
    #endregion
}

In the Controller Action:, (*7)

$refererParser = new RefererParser();

$this->publicAccessLog = new PublicAccessLog(['scenario' => PublicAccessLog::SCENARIO_INSERT]);

$this->publicAccessLog->type        = $refererParser->getType();
$this->publicAccessLog->description = $refererParser->getDescription();
$this->publicAccessLog->source      = $refererParser->getSource();
$this->publicAccessLog->medium      = $refererParser->getMedium();
$this->publicAccessLog->term        = $refererParser->getTerm();
$this->publicAccessLog->content     = $refererParser->getContent();
$this->publicAccessLog->campaign    = $refererParser->getCampaign();
$this->publicAccessLog->device      = $refererParser->getDevice();

$this->publicAccessLog->save(false);

License

yii2-nyx-referer-parser is released under the BSD 3-Clause License. See the bundled LICENSE.md for details., (*8)

Yii2, (*9)

The Versions

27/05 2017

dev-master

9999999-dev

Yii2 Referer Parser

  Sources   Download

BSD-3-Clause

The Requires

 

by Jonatas Sas

framework extension php yii2 migration

27/05 2017

1.0.6

1.0.6.0

Yii2 Referer Parser

  Sources   Download

BSD-3-Clause

The Requires

 

by Jonatas Sas

framework extension php yii2 migration

25/10 2016

1.0.5

1.0.5.0

Yii2 Referer Parser

  Sources   Download

BSD-3-Clause

The Requires

 

by Jonatas Sas

framework extension php yii2 migration

14/10 2016

1.0.4

1.0.4.0

Yii2 Referer Parser

  Sources   Download

BSD-3-Clause

The Requires

 

by Jonatas Sas

framework extension php yii2 migration

24/09 2016

1.0.3

1.0.3.0

Yii2 Referer Parser

  Sources   Download

Apache-2.0

The Requires

 

by Jonatas Sas

framework extension php yii2 migration

30/05 2016

1.0.2

1.0.2.0

Yii2 Referer Parser

  Sources   Download

Apache-2.0

The Requires

 

by Jonatas Sas

framework extension php yii2 migration

29/05 2016

1.0.1

1.0.1.0

Yii2 Referer Parser

  Sources   Download

Apache-2.0

The Requires

 

by Jonatas Sas

framework extension php yii2 migration

26/05 2016

1.0.0

1.0.0.0

Yii2 Referer Parser

  Sources   Download

Apache-2.0

The Requires

 

by Jonatas Sas

framework extension php yii2 migration