I am using telescope for may blog application and i able to configure google analytics by telescope admin setting. now we wanted to configure Google Tag Manager but we not able to figure out how to configure GTM with telescope. we found one addon "https://github.com/GorillaStack/meteor-iron-router-gtm" it allowed to configure GTM in meteor but its based on iron router but telescope using flow-router..
can some one please help us to configure GTM with telescope ..
this is work for me adding code to client.js in project
if(Meteor.isClient){
FlowRouter.triggers.enter( [ enterFunction ] );
FlowRouter.triggers.exit( [ exitFunction ] );
function enterFunction() {
$('body').append("<noscript id='gtmnoscript'><iframe src=\"//www.googletagmanager.com/ns.html?id=GTM-XXXXXX\" height=\"0\" width=\"0\" style=\"display:none;visibility:hidden\"></iframe></noscript><script id='gtmscript'>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-XXXXXXX');</script>")
}
function exitFunction() {
$('#gtmnoscript').remove();
$('#gtmscript').remove();
}
}