Using a Cookie to Make Certain Images Display?

metalshark

New member
Jan 3, 2011
652
5
0
I've got a nice deal setup with a local business where I am pushing Adwords traffic to their site, and if it turns into an appointment (conversion), then I get paid.

Now, I'm trying to track this precisely in order to know what ad groups are working best, but one issue I'm having is proper phone tracking. About 80% of the conversions are from phone calls.

I'm using https://www.callfire.com to track and record the phone calls, as well as using multiple numbers per ad group so that I can narrow what is working best.

I've got 2 phone numbers that are static on the website, both are simple <img src> images displaying a picture of the phone number in the header and above the contact form.

Now here's the problem:

I want to be able to use different phone numbers per ad group. So for each ad group, I created a specific tracking number, but I can only change the number by changing the images.

So, currently, I'm sending "Ad Group 1" to www.website. com/tracking#1, which is just the homepage with the desired tracking number..... BUT! If they leave that page and go anywhere else on the site, then the regular main number will display.

A solution that would work, but seems a bit unnecessary, is: Set up several sub domains that are identical copies of the website, aside from the tracking number, and have all

"Ad Group 1" go to tracking#1.website.com

"Ad Group 2" go to tracking#2.website.com

"Ad Group 3" go to tracking#3.website.com

Ect.


^^^This seems like quite a bit of hassle just to simply make an image stick.

What I'd rather do is setup a cookie so that if someone went to website.com/tracking#1, then went to any other page, the tracking # images would stick.

I really don't know how to set that up, but I'd imagine it would be a fairly easy task. Does this sound like a better solution? Or perhaps there is a much better way to do this?
 


HTML:
$cookie = ($_COOKIE['whichNumber'];

if($number == "number1"){
echo "<img src='' />";
} else if($number == "number2"){
echo "<img src='' />";
} else {
echo "<img src='' />";
}
 
What I do with my Adwords campaign is push it through its own page with variables:

So all adwords go to domain.com/adwords

Then I append a varaible to the end adgroup and keyword.

So now I get domain.com/adwords/?adgroup=xxx&keyword=xxx

Then I have a big php switch with all the many options and 'in's for all my traffic sources:

Code:
Get keyword
get adgroup

condition adgroup 1
    set cookie
         keyword =xxx
         adgroup =1

condition adgroup 2
     set cookie
         keyword=xxx
         adgroup = 2

header redirect to real landing page


Now that I am on the real landing page I dynamically change the content off the adgroup and keyword.

Code:
Did you find <?php echo $_COOKIE['keyword']; ?>?

In the case of your images
just echo out different images for the phone numbers now.

This is a very flexible way to do this because it will easily and cleanly support any subid, sources, dynamic info you need to pass without too many changes. Ideally, if you are only changing a graphic, you do not want multiple pages or versions of your site. That will get messy as you make more ad groups, start running BingAds or whatever the future holds.
 
  • Like
Reactions: metalshark