• Hi,

    Is it possible to add a condition to insert or not the tracking code? Let say I have a plugin that allows me to put a script for GDPR and when it’s enable for tracking I will add this small script in header, only to initialise a variable.

    
    <script type="text/javascript">
         var consent_analytics = 1
    </script>
    

    So, I would like a condition to insert code:

    if( typeof consent_analytics != "undefined" && consent_analytics == 1 ){
    
    //Insert code
    } 

    Is it possible?

    Thanks for helping

    • This topic was modified 1 year, 4 months ago by  tosc.
  • The topic ‘Condition to insert the code’ is closed to new replies.