Skip to content
Snippets Groups Projects
Commit d09b4289 authored by llaffont's avatar llaffont
Browse files

Google analytics: maj trackEvent

parent d787d0f7
Branches
Tags
No related merge requests found
......@@ -55,7 +55,7 @@ class AuthController extends Zend_Controller_Action
return $this->view->_('Identifiant ou mot de passe incorrect.');
$user = Class_Users::getIdentity();
$this->_helper->trackEvent('authentification', 'login', $user->getId());
$this->_helper->trackEvent('authentification', 'connexion', 'utilisateur', 'id: '.$user->getId());
$service_cas_server=$this->_request->getPost('service');
if (strlen($service_cas_server)>1) {
$ticket=md5(Zend_Session::getId());
......
......@@ -23,17 +23,18 @@ class ZendAfi_Controller_Action_Helper_TrackEvent extends Zend_Controller_Action
/**
* voir [[file:~/public_html/afi-opac3/library/Class/ScriptLoader.php::public%20function%20executeTrackEvents()%20{][Class_ScriptLoader::executeTrackEvents]]
*/
public function trackEvent($category, $action, $value) {
public function trackEvent($category, $action, $label, $value) {
$this->getActionController()
->getHelper('flashMessenger')
->addMessage([ZendAfi_Controller_Action_Helper_FlashMessenger::TRACK_EVENT =>
['category' => $category,
'action' => $action,
'value' => 2]]);
'label' => $label,
'value' => $value]]);
}
public function direct($category, $action, $value) {
return $this->trackEvent($category, $action, $value);
public function direct($category, $action, $label, $value) {
return $this->trackEvent($category, $action, $label, $value);
}
}
......
......@@ -480,8 +480,9 @@ class AuthControllerPostSimpleSuccessfulTest extends AuthControllerPostSimpleTes
public function trackEventShouldBeGenerated() {
$this->assertFlashMessengerContains(['track_event' =>
['category' => 'authentification',
'action' => 'login',
'value' => '2']]);
'action' => 'connexion',
'label' => 'utilisateur',
'value' => 'id: 2']]);
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment