templates/gtm-blank/gtm-blank.html.twig line 1

Open in your IDE?
  1. <!DOCTYPE html>
  2. <html lang="fr">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <title>Page GTM Vierge & First ID</title>
  6.     <link rel="icon"
  7.           href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text></svg>">
  8.     <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/css/bootstrap.min.css"
  9.           integrity="sha384-zCbKRCUGaJDkqS1kPbPd7TveP5iyJE0EjAuZQTgFLD2ylzuqKfdKlfG/eSrtxUkn" crossorigin="anonymous">
  10.     <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
  11.     <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/js/bootstrap.bundle.min.js"
  12.             integrity="sha384-fQybjgWLrvvRgtW6bFlB7jaZrFsaBXjsOMm/tB9LTS58ONXgqbR9W8oWht/amnpF"
  13.             crossorigin="anonymous"></script>
  14.     <!-- Google Tag Manager -->
  15.     <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
  16.     new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
  17.     j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
  18.     'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
  19.     })(window,document,'script','dataLayer','GTM-NFW6BNDL');</script>
  20.     <!-- GTM-NFW6BNDL for client side -->
  21.     <!-- GTM-5VL52TTX for to contact server gtm -->
  22.     <!-- End Google Tag Manager -->
  23. </head>
  24. <body>
  25. <!-- Google Tag Manager (noscript) -->
  26. <noscript>
  27.     <iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NFW6BNDL"
  28.             height="0" width="0" style="display:none;visibility:hidden"></iframe>
  29. </noscript>
  30. <!-- End Google Tag Manager (noscript) -->
  31. <nav class="navbar navbar-expand-lg navbar-light bg-light">
  32.     <a class="navbar-brand" href="{{ path('app_index') }}">{{ site_name }}</a>
  33.     <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
  34.             aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
  35.         <span class="navbar-toggler-icon"></span>
  36.     </button>
  37. </nav>
  38. <div class="container">
  39.     <div class="row">
  40.         <div class="col-md-12">
  41.             <h1>Page GTM Vierge & First ID</h1>
  42.             <p>First ID : <span id="firstid"></span></p>
  43.         </div>
  44.     </div>
  45. </div>
  46. <script>
  47.     function getCookieValueFromCookieName(cookieName) {
  48.         let cookieArr = document.cookie.split(";");
  49.         for (let i = 0; i < cookieArr.length; i++) {
  50.             let cookiePair = cookieArr[i].split("=");
  51.             if (cookieName === cookiePair[0].trim()) {
  52.                 return decodeURIComponent(cookiePair[1]);
  53.             }
  54.         }
  55.         return null;
  56.     }
  57.     let interval = undefined;
  58.     function updateFid() {
  59.         let fid = getCookieValueFromCookieName('firstid');
  60.         if (fid) {
  61.             if (interval) {
  62.                 clearInterval(interval);
  63.             }
  64.             $('#firstid').text(fid);
  65.         } else {
  66.             $('#firstid').text('No First ID cookie find.');
  67.         }
  68.     }
  69.     interval = setInterval(updateFid, 1000);
  70. </script>
  71. </body>
  72. </html>