INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Create promotion urls

Create promotion urls

(OP)
We have a wordpress website and are planning on advertising in various places. I wanted to give each promotion a different url so that we can track how many visits we get per promotion.

Something like www.website.com/abc

Each one will send the visitor to the homepage, we will then look how many visits www.website.com/abc got in google analytics.

I know it has limitations and requires the visitors to type the full url but any data we can get about each promotion is essential for us.

How would I go about doing this in wordpress? I looked for a plugin but couldn't find one, does anyone know of a plugin or manual solution?

Thanks

RE: Create promotion urls

When you create your page under the name you give the page will be the Permalink URL which is auto generated. You can click on the link and change it to whatever you want.

You could also create a re-direct from the directory you want and have it point to the correct address for the promotion.

You can also modify your HTACCESS to do this.

There you have 3 options.

Darryn Cooke
www.darryncooke.com | Marketing and Creative Services

RE: Create promotion urls

If you want the tracking code to be recorded by your site analytics you would be better off using a parameter in the URL.

Or you could add some php code to your '404' page to make it 'smart'

CODE --> php

<?php
$URIs = array(
	"128_163" => "/blankets/",
	"128_164" => "/mobiles/"
);

$request = $_SERVER['REQUEST_URI'];

foreach ($URIs as $req => $dest ) {
	$goto = '';
	if (inStr($req, $request)) {
	$goto = $dest;
		header("HTTP/1.1 301 Moved Permanently");
		header("Location:".$goto);
	break;
	}
}
if ($goto  == '') {
	header("HTTP/1.1 404 Not Found");
}


function inStr ($find, $inWhat) {
  $findLen = strlen($find);
  $i = 0;
  for($i=0; $i < strlen($inWhat); $i++) 
  {
    if(substr($inWhat, $i, $findLen) == $find) 
    {
      return TRUE; 
    }
  }
  return FALSE;
}  
?> 

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close