forked from cybercog/yii2-google-analytics
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
70a765c
commit 5b55776
Showing
5 changed files
with
75 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,24 @@ | ||
{ | ||
"name": "cybercog/yii2-google-analytics", | ||
"description": "Google Analytics extension for the Yii2 framework", | ||
"name": "thiagotalma/yii2-hotjar", | ||
"description": "Hotjar extension for the Yii2 framework", | ||
"keywords": [ | ||
"yii2", | ||
"google", | ||
"analytics" | ||
"hotjar" | ||
], | ||
"type": "yii2-extension", | ||
"license": "BSD-3-Clause", | ||
"authors": [ | ||
{ | ||
"name": "Anton Komarev", | ||
"email": "[email protected]" | ||
"name": "Thiago Talma", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"require": { | ||
"yiisoft/yii2": "*" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"cybercog\\yii\\googleanalytics\\": "src" | ||
"talma\\hotjar\\": "src" | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
/** | ||
* @link https://github.com/thiagotalma/yii2-hotjar | ||
* @copyright Copyright (c) 2015 LLC CyberCog | ||
* @license http://opensource.org/licenses/BSD-3-Clause | ||
*/ | ||
namespace talma\hotjar\widgets; | ||
|
||
use yii\base\Widget; | ||
|
||
/** | ||
* Class HotjarTracking | ||
* @package talma\hotjar\widgets | ||
* @author Thiago Talma <[email protected]> | ||
*/ | ||
class HotjarTracking extends Widget | ||
{ | ||
|
||
/** | ||
* Render <script></script> | ||
* @var bool | ||
*/ | ||
public $omitScriptTag = false; | ||
|
||
/** | ||
* The Hotjar Tracking ID | ||
* @var string | ||
*/ | ||
public $trackingId = null; | ||
|
||
/** | ||
* @var array | ||
*/ | ||
private $_viewParams; | ||
|
||
public function init() | ||
{ | ||
parent::init(); | ||
|
||
$this->_viewParams = [ | ||
'omitScriptTag' => $this->omitScriptTag, | ||
'trackingId' => $this->trackingId, | ||
]; | ||
} | ||
|
||
public function run() | ||
{ | ||
echo $this->render('tracking', $this->_viewParams); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters