78 lines
2.4 KiB
PHP
78 lines
2.4 KiB
PHP
<?php
|
|
/**
|
|
* 2022 ECSoft
|
|
*
|
|
* NOTICE OF LICENSE
|
|
*
|
|
* This source file is subject to the Academic Free License (AFL 3.0)
|
|
* that is bundled with this package in the file LICENSE.txt.
|
|
* It is also available through the world-wide-web at this URL:
|
|
* http://opensource.org/licenses/afl-3.0.php
|
|
* If you did not receive a copy of the license and are unable to
|
|
* obtain it through the world-wide-web, please send an email
|
|
* to dev.ecsoft@gmail.com so we can send you a copy immediately.
|
|
*
|
|
* @author ECSoft <dev.ecsoft@gmail.com>
|
|
* @copyright 2022 ECSoft
|
|
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
|
* International Registered Trademark & Property of ECSoft
|
|
*/
|
|
include_once dirname(__FILE__) . '/EcsGtmProModelAbstract.php';
|
|
|
|
class EcsGtmProGtmUserIdConfig extends EcsGtmProModelAbstract
|
|
{
|
|
public $add_user_id;
|
|
public $add_guest_id;
|
|
public $async;
|
|
|
|
public function rules()
|
|
{
|
|
return array(
|
|
array(
|
|
array(
|
|
'add_user_id',
|
|
'add_guest_id',
|
|
'async'
|
|
), 'safe'
|
|
)
|
|
);
|
|
}
|
|
|
|
public function attributeDefaults()
|
|
{
|
|
return array(
|
|
'add_user_id' => 1,
|
|
'add_guest_id' => 1,
|
|
'async' => 1
|
|
);
|
|
}
|
|
|
|
public function attributeLabels()
|
|
{
|
|
return array(
|
|
'add_user_id' => $this->l('Add User ID to the DataLayer', 'EcsGtmProGtmUserIdConfig'),
|
|
'add_guest_id' => $this->l('Add User ID to the DataLayer for guests', 'EcsGtmProGtmUserIdConfig'),
|
|
'async' => $this->l('Async loading of user info', 'EcsGtmProGtmUserIdConfig'),
|
|
);
|
|
}
|
|
|
|
public function attributeDescriptions()
|
|
{
|
|
return array(
|
|
'add_user_id' => $this->l('Add variables "userId" and "userLogged" to the DataLayer.', 'EcsGtmProGtmUserIdConfig'),
|
|
'add_guest_id' => $this->l('Variable "userId" is set with guest_[GUEST_ID] when the user is a guest. This option allows tracking of users not logged across multiple sessions.', 'EcsGtmProGtmUserIdConfig'),
|
|
'async' => $this->l('If you have a full-page cache system, you will need to load user information asynchronously.', 'EcsGtmProGtmUserIdConfig'),
|
|
);
|
|
}
|
|
|
|
public function configKey()
|
|
{
|
|
return 'ecsgtm_userid';
|
|
}
|
|
|
|
public function getActiveTab()
|
|
{
|
|
return 'EcsGtmProGtmConfig';
|
|
}
|
|
}
|