Home › Forums › Back End › If/Else statement, different analytics code depending on URL › Re: If/Else statement, different analytics code depending on URL
December 8, 2009 at 4:35 pm
#67854
Member
There are a lot of different ways of doing this. PHP_SELF would be pretty safe for this:
Code:
$mypath = $_SERVER[“PHP_SELF”];
if (substr_count($mypath, “customer”) > 0) { // Catch customer
} elseif (substr_count($mypath, “documents”) > 0){ // Catch documents
} else { // Catch all
}