Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 9th Oct 2012, 08:06 AM   #1
Active Warrior
War Room Member
 
Join Date: 2012
Posts: 31
Thanks: 26
Thanked 5 Times in 5 Posts
Default
Wordpress: query string GET and use on pages?
Share on: 
fb share twitter share gplus share more share

Hey Warriors!

I'm actually wondering if there is a NON-programming solution to this.

I like to track all my ad campaigns, sometimes with more than one variable.

Example: myawesomesite.com?CampaignID=Facebook&SubCampaignI D=ad03a

I normally just create all my webpages from scratch, and in PHP its a simple matter of grabbing the variables from the query string, then just passing those arguments on through my site whenever I want to link to another page.

example link: myawesomesite.com/about.php?CampaignID=<?= $CampaignID ?>&SubCampaignID=<?= $SubCampaignID ?>

The idea is to ultimately capture this when the user completes a call to action of some sort, either placing an order or opting in to a list, etc., and then storing this info in my database.

So, an opt-in form on my site would have a hidden field something like:
<input type="hidden" name="CampaignID" value="<?= $CampaignID ?>" />

But, I'm just starting out with Wordpress, and am not sure if there is some kind of "built in" method for grabbing the query string variables and then "displaying" them on the page. For me, I'll just be using the variables in links or hidden fields on a form, but you get the idea.

Any advice on built in WP funtions to handle this folks? A simple plugin?

If you aren't using this method, how are all you Wordpress whiz's tracking your campaigns?

I spent quite a bit of time googling, but came up short. Could be I am just not thinking the right keywords to be searching on though...

Thanks!

Matt
MktgGuy is offline  
Unread 9th Oct 2012, 10:18 AM   #2
HyperActive Warrior
War Room Member
 
dwoods's Avatar
 
Join Date: 2012
Location: Ohio, USA
Posts: 139
Thanks: 8
Thanked 35 Times in 31 Posts
Default
Re: Wordpress: query string GET and use on pages?
Share on: 
fb share twitter share gplus share more share

Yes you can do this easily by adding the same code you use for your raw php verison to the theme files in your wordpress installation.

Need a way to drive traffic to your new site?
-- Check out HelpMyHits.com!
dwoods is offline  
The Following User Says Thank You to dwoods For This Useful Post:
Unread 9th Oct 2012, 10:20 AM   #3
HyperActive Warrior
 
Join Date: 2012
Posts: 153
Thanks: 1
Thanked 7 Times in 7 Posts
Default
Re: Wordpress: query string GET and use on pages?
Share on: 
fb share twitter share gplus share more share

Add this code in your header.php file and it'll do
boilingstocks is offline  
The Following User Says Thank You to boilingstocks For This Useful Post:
Unread 9th Oct 2012, 10:23 AM   #4
Active Warrior
War Room Member
 
Join Date: 2012
Posts: 31
Thanks: 26
Thanked 5 Times in 5 Posts
Default
Re: Wordpress: query string GET and use on pages?
Share on: 
fb share twitter share gplus share more share

Thanks folks.

I thought it might be something like that, but was hoping to avoid modifying any of the theme files. Not sure, but I think potential future theme updates would overwrite that. (Not a huge deal, as its just a few lines of code, but still.)

Thanks again.

Matt
MktgGuy is offline  
Unread 9th Oct 2012, 10:26 AM   #5
HyperActive Warrior
 
Join Date: 2012
Posts: 153
Thanks: 1
Thanked 7 Times in 7 Posts
Default
Re: Wordpress: query string GET and use on pages?
Share on: 
fb share twitter share gplus share more share

Just make use of Wordpress - child themes feature so that future updates don't erase your code and everything works fine !
boilingstocks is offline  
The Following User Says Thank You to boilingstocks For This Useful Post:
Unread 9th Oct 2012, 10:35 AM   #6
Active Warrior
War Room Member
 
Join Date: 2012
Posts: 31
Thanks: 26
Thanked 5 Times in 5 Posts
Default
Re: Wordpress: query string GET and use on pages?
Share on: 
fb share twitter share gplus share more share

Wordpress - child themes feature
D'oh! I totally forgot about this.

Wordpress n00b here.

Thanks a ton.

Matt
MktgGuy is offline  
Closed Thread


Bookmarks

Tags
pages, query, string, wordpress


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 10:12 AM.