Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End If/Else statement, different analytics code depending on URL Re: If/Else statement, different analytics code depending on URL

#67860
JaredAM
Member

Humm, with that tree, PHP_SELF will still work, but you’ll have to rearrange the if/elses or else customer would be caught right off the bat.

Code:
$mypath = $_SERVER[“PHP_SELF”];

if (substr_count($mypath, “documents”) > 0) { // Catch documents

} elseif (substr_count($mypath, “quote”) > 0){ // Catch quote

} else { // Catch all (customer)

}