This doesn’t help me track where my conversions are coming from originally (to my site), i.e. if they are from social media, AdWords, organic, etc.
Is there a way (using JS/PHP?) to automatically and dynamically add, to the end of the URL, either:
1. A unique user ID, or
2. The referral domain/type?
3. Any such identifier from Google Analytics
So my url would be like https://www.example.com/?source=facebook for example.
]]>I can see (in Google Analytics) where people come from and which button/link they click to leave. I can see (in my affiliate program’s backend) how many conversions I get from those clicks.
What I cannot see is where those conversions originally came from. I want to know if visitors from a particular source convert better, so I can keep optimizing my efforts.
If there was a way to automatically append the exit url (on my site) with the referral domain, then I would also see it in the affiliate backend. It must be possible somehow!
]]>https://timfelmingham.com/adwords-conversion-tracking-affilates/
I use (a variant of) this code:
<?php
$gclid=$_GET['gclid'];
$outgoinglink = 'https://www.merchants_website.com/mylandingpage.html?affID=12345&subid='. $gclid;
?>
Then add gclid=whatever to my inbound links (from Facebook, etc.). Works perfectly on “naked” links. Because I use redirects for all outbound links, it’s not as easy as it should be, but I will figure that part out!
]]><?php
setcookie("source",$_GET['utm_source'],time()+60*60*24*30, '/');
?>
Then you can access what is stored in the cookie in many ways, for example:
echo $_COOKIE["source"];