Browse Source

Prevent getquanty to be loaded twice

Amauri CHAMPEAUX 4 years ago
parent
commit
f7a12bcb9a
1 changed files with 6 additions and 0 deletions
  1. 6 0
      tarteaucitron.services.js

+ 6 - 0
tarteaucitron.services.js

@@ -3934,6 +3934,10 @@ tarteaucitron.services.getquanty = {
             return;
         }
 
+        if (tarteaucitron.user.getquantyAlreadyLoaded !== undefined) {
+            return;
+        }
+
         tarteaucitron.addScript('https://get.smart-data-systems.com/gq?site_id=' + tarteaucitron.user.getguanty + '&consent=1');
     },
     "fallback": function () {
@@ -3942,6 +3946,8 @@ tarteaucitron.services.getquanty = {
             return;
         }
 
+        tarteaucitron.user.getquantyAlreadyLoaded = true;
+
         tarteaucitron.addScript('https://get.smart-data-systems.com/gq?site_id=' + tarteaucitron.user.getguanty + '&notrack=1');
     }
 };