added entree page tracking, added title to ajax response for tracking (production, agenda, search)
This commit is contained in:
@@ -79,7 +79,8 @@ class AgendaController extends ControllerBase {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'rendered'=> $rendered
|
'rendered'=> $rendered,
|
||||||
|
'title'=>'Agenda',
|
||||||
];
|
];
|
||||||
|
|
||||||
// translations links
|
// translations links
|
||||||
|
|||||||
@@ -662,13 +662,20 @@
|
|||||||
var $li = $link.parents('li');
|
var $li = $link.parents('li');
|
||||||
var sys_path = $link.attr('data-drupal-link-system-path');
|
var sys_path = $link.attr('data-drupal-link-system-path');
|
||||||
var url = $link.attr('href');
|
var url = $link.attr('href');
|
||||||
|
var title = $link.text();
|
||||||
if(!$li.is('.opened')){
|
if(!$li.is('.opened')){
|
||||||
_$entrees_block_termlinks.parents('li').removeClass('opened');
|
_$entrees_block_termlinks.parents('li').removeClass('opened');
|
||||||
$li.addClass('opened');
|
$li.addClass('opened');
|
||||||
$li.parents('.item-list').addClass('opened')
|
$li.parents('.item-list').addClass('opened')
|
||||||
filterEntree(tid);
|
filterEntree(tid);
|
||||||
if(bubbling){
|
if(bubbling){
|
||||||
_$body.trigger({'type':'open_entree', 'tid':tid, 'url':url, 'sys_path':sys_path});
|
_$body.trigger({
|
||||||
|
'type':'open_entree',
|
||||||
|
'tid':tid,
|
||||||
|
'url':url,
|
||||||
|
'sys_path':sys_path,
|
||||||
|
'title':title
|
||||||
|
});
|
||||||
}
|
}
|
||||||
// bubbling is true only when event is a real click on entree link
|
// bubbling is true only when event is a real click on entree link
|
||||||
}else if(bubbling){
|
}else if(bubbling){
|
||||||
@@ -800,6 +807,10 @@
|
|||||||
_no_articles_nodes[i].fade();
|
_no_articles_nodes[i].fade();
|
||||||
}
|
}
|
||||||
updateRandomPlaylist(_articles_nodes);
|
updateRandomPlaylist(_articles_nodes);
|
||||||
|
if(typeof _paq !== 'undefined'){
|
||||||
|
// trackEvent(category, action, [name], [value])
|
||||||
|
_paq.push(['trackEvent', 'Corpus Articles', 'on']);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
function deactivateArticlesFilter(){
|
function deactivateArticlesFilter(){
|
||||||
//console.log('deactivateArticlesFilter');
|
//console.log('deactivateArticlesFilter');
|
||||||
@@ -808,6 +819,10 @@
|
|||||||
_no_articles_nodes[i].unFade();
|
_no_articles_nodes[i].unFade();
|
||||||
}
|
}
|
||||||
updateRandomPlaylist(_playlist);
|
updateRandomPlaylist(_playlist);
|
||||||
|
if(typeof _paq !== 'undefined'){
|
||||||
|
// trackEvent(category, action, [name], [value])
|
||||||
|
_paq.push(['trackEvent', 'Corpus Articles', 'off']);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
function shutDownArticles(){
|
function shutDownArticles(){
|
||||||
// shutdown articles if active
|
// shutdown articles if active
|
||||||
|
|||||||
@@ -662,13 +662,20 @@
|
|||||||
var $li = $link.parents('li');
|
var $li = $link.parents('li');
|
||||||
var sys_path = $link.attr('data-drupal-link-system-path');
|
var sys_path = $link.attr('data-drupal-link-system-path');
|
||||||
var url = $link.attr('href');
|
var url = $link.attr('href');
|
||||||
|
var title = $link.text();
|
||||||
if(!$li.is('.opened')){
|
if(!$li.is('.opened')){
|
||||||
_$entrees_block_termlinks.parents('li').removeClass('opened');
|
_$entrees_block_termlinks.parents('li').removeClass('opened');
|
||||||
$li.addClass('opened');
|
$li.addClass('opened');
|
||||||
$li.parents('.item-list').addClass('opened')
|
$li.parents('.item-list').addClass('opened')
|
||||||
filterEntree(tid);
|
filterEntree(tid);
|
||||||
if(bubbling){
|
if(bubbling){
|
||||||
_$body.trigger({'type':'open_entree', 'tid':tid, 'url':url, 'sys_path':sys_path});
|
_$body.trigger({
|
||||||
|
'type':'open_entree',
|
||||||
|
'tid':tid,
|
||||||
|
'url':url,
|
||||||
|
'sys_path':sys_path,
|
||||||
|
'title':title
|
||||||
|
});
|
||||||
}
|
}
|
||||||
// bubbling is true only when event is a real click on entree link
|
// bubbling is true only when event is a real click on entree link
|
||||||
}else if(bubbling){
|
}else if(bubbling){
|
||||||
@@ -800,6 +807,10 @@
|
|||||||
_no_articles_nodes[i].fade();
|
_no_articles_nodes[i].fade();
|
||||||
}
|
}
|
||||||
updateRandomPlaylist(_articles_nodes);
|
updateRandomPlaylist(_articles_nodes);
|
||||||
|
if(typeof _paq !== 'undefined'){
|
||||||
|
// trackEvent(category, action, [name], [value])
|
||||||
|
_paq.push(['trackEvent', 'Corpus Articles', 'on']);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
function deactivateArticlesFilter(){
|
function deactivateArticlesFilter(){
|
||||||
//console.log('deactivateArticlesFilter');
|
//console.log('deactivateArticlesFilter');
|
||||||
@@ -808,6 +819,10 @@
|
|||||||
_no_articles_nodes[i].unFade();
|
_no_articles_nodes[i].unFade();
|
||||||
}
|
}
|
||||||
updateRandomPlaylist(_playlist);
|
updateRandomPlaylist(_playlist);
|
||||||
|
if(typeof _paq !== 'undefined'){
|
||||||
|
// trackEvent(category, action, [name], [value])
|
||||||
|
_paq.push(['trackEvent', 'Corpus Articles', 'off']);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
function shutDownArticles(){
|
function shutDownArticles(){
|
||||||
// shutdown articles if active
|
// shutdown articles if active
|
||||||
|
|||||||
@@ -102,6 +102,7 @@ class ProductionsController extends ControllerBase {
|
|||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'rendered'=> $rendered,
|
'rendered'=> $rendered,
|
||||||
|
'title'=> 'Productions',
|
||||||
// 'block' => array(
|
// 'block' => array(
|
||||||
// 'rendered'=> \Drupal::service('renderer')->renderRoot($block_render),
|
// 'rendered'=> \Drupal::service('renderer')->renderRoot($block_render),
|
||||||
// 'region'=> str_replace('_', '-', $block->getRegion()),
|
// 'region'=> str_replace('_', '-', $block->getRegion()),
|
||||||
@@ -120,7 +121,7 @@ class ProductionsController extends ControllerBase {
|
|||||||
'#set_active_class' => TRUE,
|
'#set_active_class' => TRUE,
|
||||||
];
|
];
|
||||||
$translations_rendered = \Drupal::service('renderer')->executeInRenderContext(new RenderContext(), function () use ($translations_build) {return render($translations_build);});
|
$translations_rendered = \Drupal::service('renderer')->executeInRenderContext(new RenderContext(), function () use ($translations_build) {return render($translations_build);});
|
||||||
|
|
||||||
$data ['translations_links'] = $translations_rendered;
|
$data ['translations_links'] = $translations_rendered;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -78,7 +78,8 @@ class EdlpSearchController extends ControllerBase {
|
|||||||
|
|
||||||
$rendered = render($this->renderable);
|
$rendered = render($this->renderable);
|
||||||
$data = [
|
$data = [
|
||||||
'rendered' => $rendered
|
'rendered' => $rendered,
|
||||||
|
'title' => 'Search',
|
||||||
];
|
];
|
||||||
|
|
||||||
// translations links
|
// translations links
|
||||||
|
|||||||
@@ -79,6 +79,18 @@
|
|||||||
// };
|
// };
|
||||||
var state = getSysPathState(e.sys_path);
|
var state = getSysPathState(e.sys_path);
|
||||||
history.pushState(state, null, e.url);
|
history.pushState(state, null, e.url);
|
||||||
|
|
||||||
|
// piwik
|
||||||
|
if(typeof _paq !== 'undefined'){
|
||||||
|
// page tracking
|
||||||
|
// https://matomo.org/blog/2017/02/how-to-track-single-page-websites-using-piwik-analytics/
|
||||||
|
_paq.push(['setCustomUrl', e.url]);
|
||||||
|
_paq.push(['setDocumentTitle', e.title]);
|
||||||
|
_paq.push(['trackPageView']);
|
||||||
|
// js event
|
||||||
|
// trackEvent(category, action, [name], [value])
|
||||||
|
// _paq.push(['trackEvent', 'AjaxNav', 'loaded', state.url]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.on('close_entree', function(e){
|
.on('close_entree', function(e){
|
||||||
|
|||||||
@@ -79,6 +79,18 @@
|
|||||||
// };
|
// };
|
||||||
var state = getSysPathState(e.sys_path);
|
var state = getSysPathState(e.sys_path);
|
||||||
history.pushState(state, null, e.url);
|
history.pushState(state, null, e.url);
|
||||||
|
|
||||||
|
// piwik
|
||||||
|
if(typeof _paq !== 'undefined'){
|
||||||
|
// page tracking
|
||||||
|
// https://matomo.org/blog/2017/02/how-to-track-single-page-websites-using-piwik-analytics/
|
||||||
|
_paq.push(['setCustomUrl', e.url]);
|
||||||
|
_paq.push(['setDocumentTitle', e.title]);
|
||||||
|
_paq.push(['trackPageView']);
|
||||||
|
// js event
|
||||||
|
// trackEvent(category, action, [name], [value])
|
||||||
|
// _paq.push(['trackEvent', 'AjaxNav', 'loaded', state.url]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.on('close_entree', function(e){
|
.on('close_entree', function(e){
|
||||||
|
|||||||
Reference in New Issue
Block a user