Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Tag Manager Preview mode does not work in Aurelia

Tags:

I've added the google tag manager to the aurelia skeleton application. I can create tags in the GTM and the app fires the events which I can see in the Google Analytics dashboard. The problem is that the preview mode does not work. The iframe shows up while the app is loading and then disappears. What could be the cause of this? Does preview mode work in a Single Page Application?

Here's the link of the Aurelia App with GTM: https://sofoklism.github.io/spm/#/

like image 495
Spiff Avatar asked Sep 14 '17 16:09

Spiff


1 Answers

Move aurelia-app="main" from the <body> to another element, a <div> for example.

<body>
  <!-- ... -->
  <div aurelia-app="main">
    <div class="splash"><!-- ... --></div>
  </div>
  <!-- ... -->
</body>

Aurelia replaces the content of the app host element, so any content added before .setRoot completes gets removed. This is how the splash screen gets removed.

like image 176
strahil Avatar answered Sep 30 '22 01:09

strahil