Can anyone assist? I'm not a programmer so please forgive me in advance.
I’ve tested the code below but it’s not redirecting (no errors on the page) As an FYI, I tested only using two incoming links, I added the third elseif here for better clarification.
----------------------------------------------------------------------------------------------
Problem:
Need to capture campaign ID from print ads and/or direct links. An easy fix would be a tracking pixel on the page but our current analytics program does not provide it (can’t purchase another program, our company is too invested in the current).
Goal:
To just add another elseif expression for new print ads and/or redirects, i.e. until our analytics company develops a solution (simple as opposed to creating a sub domain w/ a redirect for each new incoming link)
Important Notes:
The code should be case sensitive because the incoming link may sometimes come from same domain but with a different campaign ID (see example below)
I did manage to capture the campaign ID using to two domain autoforwards but that will only work for one incoming link.
----------------------------------------------------------------------------------------------
EXAMPLE
Print Ad URL #1 >>>domain autoforward>>>
http://www.PurchasedDomain55.com/?ut...paign=PrintAD1 >>>php redirect>>>
http://www.DestinationPage44.com/?ut...&utm_campaign= PrintAD1
Print Ad URL #2 >>>domain autoforward>>>
http://www.PurchasedDomain55.com/?ut...&utm_campaign= PrintAD2 >>>php redirect>>> www. DestinationPage44.com/?utm_source=blog&utm_campaign= PrintAD2
Print Ad URL #3 >>>domain autoforward>>>
http://www.PurchasedDomain55.com/?ut...&utm_campaign= PrintAD3 >>>php redirect>>> www. DestinationPage44.com/?utm_source=blog&utm_campaign= PrintAD3
----------------------------------------------------------------------------------------------
CODE
<?php $referrer = $_SERVER['HTTP_REFERER'];
if (stripos($referrer, '
http://www.PurchasedDomain55.com/?ut...paign=PrintAD1 ') !== false)
{ header("location:
http://www.DestinationPage44.com/?ut...&utm_campaign= PrintAD1"); }
elseif (stripos($referrer, '
http://www.PurchasedDomain55.com/?ut...&utm_campaign= PrintAD2 ') !== false)
{ header("location: www. DestinationPage44.com/?utm_source=blog&utm_campaign= PrintAD2"); }
elseif (stripos($referrer, '
http://www.PurchasedDomain55.com/?ut...&utm_campaign= PrintAD3 ') !== false)
{ header("location: www. DestinationPage44.com/?utm_source=blog&utm_campaign= PrintAD3"); }
?>