* @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'; } }