Skip to content

Instantly share code, notes, and snippets.

@underdown
Created October 3, 2013 18:57
Show Gist options
  • Select an option

  • Save underdown/6815103 to your computer and use it in GitHub Desktop.

Select an option

Save underdown/6815103 to your computer and use it in GitHub Desktop.
multivariate testing with php and google analytics
<?php
switch(rand(1,4)) {
case 1: $callb = array("call_button2.png", "Click to Call Button a1", "We're Here To Help"); break;
case 2: $callb = array("call_button3.png", "Click to Call Button a2", "Our scheduling department is happy to assist you");break;
case 3: $callb = array("call_button2.png", "Click to Call Button a3", "Our scheduling department is happy to assist you"); break;
case 4: $callb = array("call_button3.png", "Click to Call Button a4", "We're Here To Help");break;
}
?>
<a href="tel:<?php echo $id['PHONE']?>" onclick="_gaq.push(['_trackEvent', 'Mobile', '<?php echo $callb[1];?>', '<?php echo $callb[2];?>'])"><?php echo $id['PHONE']?></a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment