PHP Script Swapping out GA codes

This script was used to delineate Google Analytic Tracking codes between four different sites sharing the same wordpress theme files. Originally placed in footer.php above the GA tracking code provided by Google.

$host = 'https://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
if (strpos($host,'sls') !== false)
$gacode ="UA-792782-19";

elseif (strpos($host,'gai') !== false)
$gacode ="UA-792782-21";

elseif (strpos($host,'pep') !== false)
$gacode ="UA-792782-22";

elseif (strpos($host,'mvets') !== false)
$gacode ="UA-792782-23";

$gacode ="UA-792782-XX";

The script checks the URL and replaces the $gacode variable with the correct analytics code inside the provided GA script.

(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

ga('create', '<?phpecho $gacode; ?>', 'auto');
ga('send', 'pageview');