Hello All!
I am trying to figure out how to better use the referral module for something I cannot really locate in the forums. I’m wondering if someone would be so kind as to give me a hand. I’d be happy to pay for your assistance, especially if we can post it for the whole community to be aware of!
I want to deliver content based on referral source… specifically, a phone number. Referral sources, in this scenario, being yahoo, yahoo PPC, google, google PPC, bing, and bing PPC.
For step one, before we even begin differentiating between organic and PPC, I’d like to get a phone number to display if referrer = yahoo.com, google.com, or bing.com
Currently, what I have going is this:
[removed]
if (document.referrer.indexOf('yahoo.com') >=0)
{
[removed]('phonenumber1');
}
else if (document.referrer.indexOf('google.com') >=0)
{ [removed]('phonenumber2');
}
else if (document.referrer.indexOf('bing.com') >=0)
{
[removed]('phonenumber3');
}
else
{
[removed]('phonenumber4');
}
//-- Stop hiding script -->
[removed]
<noscript>phonenumber4</noscript>For those of you proficient in JS, you may know that this will NOT carry throughout the site, only on the initial landing page.
THe problem I am having when trying to utilize the referral module, is that it is detecting the long referral string (including Google keyword). I just want to splice up and grab the root… so google.com instead of ww.google.com/search?hl=en&source=hp&q=debt&aq=f&oq;=&aqi;=
So… in theory, and of course this doesn’t work, here’s how I’d do it within the referral module… Please refine/butcher/yell as you see fit. Contact me via PM if you’re interested in contracting… but again, I’d be much more comfortable paying so long as we can share this with the entire community, as I’ve seen a few threads asking about it but no solid solution.
Again, this is pseudo & non-working code… just how I would theorize this SHOULD work 😊
{if ref_from == "yahoo.com"}
Phonenumber1
{if:elseif ref_from == "google.com"}
Phonenumber2
{if:elseif ref_from == "bing.com"}
Phonenumber3
{if:else}
Phonenumber4
{/if}THANK YOU for anything at all you can offer. I’d consider myself a level 4 of 10 of EE expertise, so please keep that in mind. 😊 I’m GREAT at using docs and searching for answers tho 😊
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.