Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Turning off a section of code in html with something like an if statement

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.

like image 928
Doomie Avatar asked Oct 14 '15 17:10

Doomie


People also ask

How do you create a conditional statement in HTML?

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.

Does HTML have if else statements?

The <! --[if IE]> syntax only works in Internet Explorer. You'll need to use javascript or css to conditionally display html in other browsers.

How do you break an if statement in JavaScript?

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).


1 Answers

The better approach is to have Google analytics filter out your IP address.

https://support.google.com/analytics/answer/1034840?hl=en

like image 124
Xavier J Avatar answered Sep 30 '22 05:09

Xavier J