I have a live site and I have to keep working on it on a live site, which means I am viewing the page a lot.
I am wondering if there is a way of using like an if statement in HTML that I can turn off the google analytic's code so it doesn't mess up our reports? So I can simply change a value on the page (like a TRUE/FALSE) so I can work on it to my hearts content and I don't ruin the analytics.
Conditional Statements Use if to specify a block of code to be executed, if a specified condition is true. Use else to specify a block of code to be executed, if the same condition is false. Use else if to specify a new condition to test, if the first condition is false.
The <! --[if IE]> syntax only works in Internet Explorer. You'll need to use javascript or css to conditionally display html in other browsers.
The break statement breaks out of a switch or a loop. In a switch, it breaks out of the switch block. This stops the execution of more code inside the switch. In in a loop, it breaks out of the loop and continues executing the code after the loop (if any).
The better approach is to have Google analytics filter out your IP address.
https://support.google.com/analytics/answer/1034840?hl=en
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With