Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

Referrer Recipe Issue

Referrer Recipe Issue

Hello,
We've recently implemented the MetaMod referrer recipe and while it works perfectly for the initial visit, the problem comes when someone moves to another page. Our goal is to track PPC Leads separate from all other traffic, shows a different telephone number if someone comes from Google Ads. The problem is that when the person that came from a Google Ads, once they move to another page the other number shows up and not the PPC number. Is there any way to prevent that from happening and keep the PPC number for the duration of their session?

Here is the code:
/* was the referer Google? */
if ( $core_genius->check( "referer starts with http://www.google.com/aclk" )) {
  return 107;
}

if ( $core_genius->check( "referer starts with http://www." )) {
  return 99;
}

if ( MM_LOGGED_IN ) return 101; /* the module id for logged-in users */
else return 99; /* the module id for non-logged-in users */

Any help is appreciated

Thank you

localinternet
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Re: Referrer Recipe Issue

Hi, this is a great question. You can solve this by setting a session variable to track that the person came in from that referrer.

You could do this:

/* did we flag them as a google referrer already? */
if (@$_SESSION['myreferrer'] == "google") return 107;
if (@$_SESSION['myreferrer'] == "anotherreferrer") return 108;

/* now check the referrer */
if ( $core_genius->check( "referer starts with http://www.google.com/aclk" )) {
  $_SESSION['myreferrer'] = "google";
  return 107;
}

if ( $core_genius->check( "referer starts with http://www.anotherreferrer.com/" )) {
  $_SESSION['myreferrer'] = "anotherreferrer";
  return 108;
}


I think that will do what you want.
Best regards,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3312 Posts
User info in posts
Administrator has disabled public posting

Re: Referrer Recipe Issue

Thank you for the help! It works now.

Thanks again
Nick

localinternet
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Re: Referrer Recipe Issue

Hello,
We are also looking to do this based on setting a cookie for 30 days for that particular module? is that possible?

Thanks

localinternet
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Re: Referrer Recipe Issue

Hi,

yes, that's easy to achieve, doing it with a cookie rather than session variable.

Try this:


/* did we flag them as a google referrer already? */
if (@$_COOKIE['myreferrer'] == "google") return 107;
if (@$_COOKIE['myreferrer'] == "anotherreferrer") return 108;

$enddate = 60*60*24*30 + time();

/* now check the referrer */
if ( $core_genius->check( "referer starts with http://www.google.com/aclk" )) {
  setcookie( 'myreferrer', 'google', $enddate, '/' );
  return 107;
}

if ( $core_genius->check( "referer starts with http://www.anotherreferrer.com/" )) {
  setcookie( 'myreferrer', 'anotherreferrer', $enddate, '/' );
  return 108;
}


Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3312 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1666
Total Polls:
6
Total Posts:
5909
Dormant:
User Info:
 
Total Users:
10095
Newest User:
johnson58
Members Online:
0
Guests Online:
213

Online: 
There are no members online

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked