foreach ($bureaux as $bureau) {
- $res.='<div class="bureau" itemscope itemtype="http://schema.org/LocalBusiness">';
+ $res .= '<div class="bureau" itemscope itemtype="http://schema.org/LocalBusiness">';
- $res.='<p class="titre" itemprop="name">' . $bureau['coordonnees']['nom'] . '<p>';
+ $res .= '<p class="titre" itemprop="name">' . $bureau['coordonnees']['nom'] . '<p>';
- $res.='<div class="numeros">';
- $res.='<p itemprop="telephone">' . __('Tel') . ' ' . $this->view->linkPhone($bureau['coordonnees']['tel']) . '</p>';
+ $res .= '<div class="numeros">';
+ $event = array('category' => 'phone', 'action' => 'call', 'label' => $bureau['coordonnees']['tel']);
+ $res .= '<p itemprop="telephone">' . __('Tel') . ' ' . $this->view->linkPhone($bureau['coordonnees']['tel'], null, array('data-event' => $event)) . '</p>';
//$res.='<p itemprop="faxNumber">' . __('Fax') . ' ' . $this->view->linkPhone($bureau['coordonnees']['fax']) . '</p>';
- $res.='</div>';
+ $res .= '</div>';
//$res.= $this->view->microdataPlace($bureau['coordonnees']['adresse']);
- $res.='<div class="adresse" itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">';
- $res.='<p>' . __('Cubedesigners') . '</p>';
- $res.='<p itemprop="streetAddress">' . $bureau['coordonnees']['adresse'] . '</p>';
- $res.='<p><span itemprop="postalCode">' . $bureau['coordonnees']['code_postal'] . '</span> <span itemprop="addressLocality">' . $bureau['coordonnees']['ville'] . '</span></p>';
- $res.='<p itemprop="addressCountry">' . Zend_Locale::getTranslation($bureau['coordonnees']['pays'], 'territory') . '<p>';
- $res.='</div>';
+ $res .= '<div class="adresse" itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">';
+ $res .= '<p>' . __('Cubedesigners') . '</p>';
+ $res .= '<p itemprop="streetAddress">' . $bureau['coordonnees']['adresse'] . '</p>';
+ $res .= '<p><span itemprop="postalCode">' . $bureau['coordonnees']['code_postal'] . '</span> <span itemprop="addressLocality">' . $bureau['coordonnees']['ville'] . '</span></p>';
+ $res .= '<p itemprop="addressCountry">' . Zend_Locale::getTranslation($bureau['coordonnees']['pays'], 'territory') . '<p>';
+ $res .= '</div>';
- $res.='<div class="geoloc">';
- $res.=$this->view->linkGeo(__("Plan d'accès"), $bureau['coordonnees']['adresse'] . ',' . $bureau['coordonnees']['ville'] . ',' . Zend_Locale::getTranslation($bureau['coordonnees']['pays'], 'territory'), array('class' => 'but'));
- $res.='</div>';
+ $res .= '<div class="geoloc">';
+ $event = array('category' => 'map', 'action' => 'click', 'label' => $bureau['coordonnees']['ville']);
+ $res .= $this->view->linkGeo(__("Plan d'accès"), $bureau['coordonnees']['adresse'] . ',' . $bureau['coordonnees']['ville'] . ',' . Zend_Locale::getTranslation($bureau['coordonnees']['pays'], 'territory'), array('class' => 'but', 'data-event' => $event));
+ $res .= '</div>';
- $res.='</div>';
+ $res .= '</div>';
}
return $res;
$res = '<div class="reseaux">';
foreach ($socials as $id => $social) {
$image = $this->view->imageCms($social['picto'], $social['titre'], 25, 25);
- $res.=$this->link($image, $social['url'], array('class' => 'social', 'data-color' => $social['color']));
+ $event = array('category' => 'social', 'action' => 'go', 'label' => $social['titre']);
+ $res .= $this->link($image, $social['url'], array('class' => 'social', 'data-color' => $social['color'], 'data-event' => $event));
}
- $res.= '</div>';
+ $res .= '</div>';
return $res;
}
$res .= $this->imageSlideshowScroll($slides, 439, array(), array('shortcuts' => false));
$res .= '<div class="content description">';
- $res .= '<h1>' . $r->titre . '</h1>';
- $res .= '<ul class="tags">';
- $res .= '<li>' . $this->dateTime($realisation->date, Zend_Date::YEAR) . '</li>';
- $res .= '<li>' . Cubedesigners_Util::getCategoryById($r->categories, $this->localeDefault()) . '</li>';
- $res .= '</ul>';
+ $res .= '<h1>' . $r->titre . '</h1>';
+ $res .= '<ul class="tags">';
+ $res .= '<li>' . $this->dateTime($realisation->date, Zend_Date::YEAR) . '</li>';
+ $res .= '<li>' . Cubedesigners_Util::getCategoryById($r->categories, $this->localeDefault()) . '</li>';
+ $res .= '</ul>';
- $res .= $this->markupDotclear($r->description);
+ $res .= $this->markupDotclear($r->description);
- if (!empty($r->url->url)) {
- $res .= $this->_button($r->url);
- }
+ if (!empty($r->url->url)) {
+ $res .= $this->_button($r->url);
+ }
- $res .= '</div>';
+ $res .= '</div>';
$res .= '</article>';
return $res;
if ($b['label'] == '') {
$b['label'] = __('Voir le site');
}
- return $this->linkCMS($b, array('class' => 'but'));
+
+ $event = array('category' => 'external', 'action' => 'go', 'label' => "%href%");
+ return $this->linkCMS($b, array('class' => 'but', 'data-event' => $event));
}
}
registerLoader(load_commons);
+registerLoader(load_commons_once, true);
+
+function load_commons_once() {
+
+
+ $('a[href^="mailto:"]').not('[data-event]').each(function () {
+ var email = $(this).attr('href').split(':');
+ var label = email.pop();
+ var e = {
+ category: 'email',
+ action: 'click',
+ label: label,
+ value: 1
+ };
+ $(this).attr('data-event', JSON.stringify(e));
+ });
+
+ $('a[href^="tel:"]').not('[data-event]').each(function () {
+ var tel = $(this).attr('href').split(':');
+ var label = tel.pop();
+
+ var e = {
+ category: 'tel',
+ action: 'call',
+ label: label,
+ value: 1
+ };
+ $(this).attr('data-event', JSON.stringify(e));
+ });
+
+ $(document).on('click', '[data-event]', function () {
+ var e = $(this).data('event');
+ if (e.value === undefined) {
+ e.value = 1;
+ }
+ if (e.action === undefined) {
+ e.action = 'click';
+ }
+
+ e.label = e.label.replace(/%href%/gi, $(this).attr('href'));
+
+ ga('send', 'event', e.category, e.action, e.label, e.value);
+ return true;
+ });
+}
function load_commons() {
$(window).on('cubeitresize', resize);
return false;
});
+
// Fallback to display content in case web fonts haven't triggered the display yet
setTimeout(function () {
$('html').addClass('wf-active');