Need help with PHP code for tracking my keywords please

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
shayne54
Forum Newbie
Posts: 5
Joined: Mon Dec 01, 2008 2:23 pm

Need help with PHP code for tracking my keywords please

Post by shayne54 »

First of all thanks for the help....

I am attempting to track keywords using php for my google adwords campaign. I found the code to do this, but i am having one problem. I have added the code to my google adwords ad so that it passes the keyword on to my website like this:

http://www.your-landing-page-domain.come/?kw={keywords}

Then I added this code to my webpage to add the keyword to my affiliate url....

<?php $kw = $_GET["kw"]; //get the search keyword user typed ?>
<html>
<body>
<a href=’<?php echo “http://your-affiliate-url?sub=$kw”?>’ >Get Free Widgets Here</a>
</body>
</html>

The issue I'm having and I'm certain its an easy fix for any of you PHP experts is this:
My affiliate link is a little more complex than the example i found and placed on my website. I actually need to include my "TID" to the link like this:

http://your-affiliate-url?tid=1440.0. and then anything after the 1440.0. is used for my tracking purpose. If I dont include the 1440.0. my affiliate doesn't know that the sale came from me :? So, is there a way using PHP to make my url similar to this:

<a href=’<?php echo “http://your-affiliate-url?tid=1440.0.sub=$kw”?>’ >Get Free Widgets Here</a>

Thanks so much for the help!
-Shayne54
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Need help with PHP code for tracking my keywords please

Post by requinix »

So in other words you don't know HTML very well? Not a good thing.

Code: Select all

http://your-affiliate-url?tid=1440.0&sub=$kw
shayne54
Forum Newbie
Posts: 5
Joined: Mon Dec 01, 2008 2:23 pm

Re: Need help with PHP code for tracking my keywords please

Post by shayne54 »

tasairis wrote:So in other words you don't know HTML very well? Not a good thing.

Code: Select all

http://your-affiliate-url?tid=1440.0&sub=$kw
Um, what do you mean by that comment? It has nothing to do with HTML. I am asking for help with PHP. Before I added the PHP keyword tracking my html affiliate code worked perfectly fine. Now it doesn't. Instead of inserting my keyword, at the affiliate site it just shows sub=$kw...
Hopefully someone knowledgeable in the subject can help me out...
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Need help with PHP code for tracking my keywords please

Post by requinix »

It sounded like you were asking how to pass the tid and the sub at the same time. Am I wrong?
Hopefully someone knowledgeable in the subject can help me out...
Oh. Thanks. I'll be sure to not take that personally.
shayne54
Forum Newbie
Posts: 5
Joined: Mon Dec 01, 2008 2:23 pm

Re: Need help with PHP code for tracking my keywords please

Post by shayne54 »

[quote="tasairis"]It sounded like you were asking how to pass the tid and the sub at the same time. Am I wrong?

Yes that is exactly what I am trying to do. Sorry if I came off wrong, I know that I could teach myself PHP and I will when I have more time, but I am currently working on about 5 large products and could just really use a little help with this. Thanks for your time.

Shayne54
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Need help with PHP code for tracking my keywords please

Post by requinix »

Well, what I said is how you do it.

Code: Select all

key=value&key=value&key=value&...
Have you tried it and had problems?
shayne54
Forum Newbie
Posts: 5
Joined: Mon Dec 01, 2008 2:23 pm

Re: Need help with PHP code for tracking my keywords please

Post by shayne54 »

Yes, the problem is that it doesn't seem to load the keyword. In other words, its not showing me the keyword when i login to my affiliate site.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Need help with PHP code for tracking my keywords please

Post by requinix »

Either you're not doing quite what I said, or the link you're using isn't correct.

(sigh) What's your code now?

Do whatever you want. Your problem, not mine.
Last edited by requinix on Tue Dec 02, 2008 2:05 pm, edited 1 time in total.
shayne54
Forum Newbie
Posts: 5
Joined: Mon Dec 01, 2008 2:23 pm

Re: Need help with PHP code for tracking my keywords please

Post by shayne54 »

Well, tasaris, its seems almost like your trying to help me, but at the same time your being the worlds biggest DOUCHE. So, nevermind. go back to playing WOW, I will figure this out myself. (SIGH)
Post Reply