This question was asked by a coworker of mine at the CMS Expo in Chicago and there wasn't an answer there, so it seems like a good topic to put in front of the community.

I am looking for ideas on how to create personalized URLs in Drupal 6. I have looked for hours for a module (or a group of modules), but so far nothing has come to mind. Certainly I'm not the only person that has tried this, or would like to...

Functionality would basically be to pass a URL (www.domain.com/your_name), which would reference preset information (maybe from Profile?) to determine relevant content for that user. For example, if you had a field or fields that collected interests in Profile or whatever module is storing the user's info (say marketing, science, technology), the home page that link would direct you to would display content that is relevant for their selection, and possibly populate some content from the fields. Such as displaying "Welcome [first_name]", etc.

In a perfect world, if the user was logged in, the functionality may be deep enough to make relevant information through the site more prominent based on their selection(s), but the previous paragraph would be a good starting point. :-)

I've never coded a Drupal module and I have a feeling this would not be an easy starting point especially with limited time to focus on it, so I wanted to see if there would be a community interest to join forces to develop one if nobody has had success, or has ideas on how to accomplish such a thing with existing modules.

Thank you, and I look forward to seeing what we can all come up with!

Comments

Mateo1041’s picture

I'd have an interest in something like this as well. There are a few ways I would envision this could work, but am curious if anyone out there has attempted this with Drupal before. Something like this could probably be done outside Drupal with subdomains also as another idea.

yuriy.babenko’s picture

Have you seen the PathAuto module?
After you enable it you'll be able to go to Site Building -> URL Aliases -> Automated Alias Settings to set the URL for user profiles. You'll be able to use various tokens from nodes and users as part of the URL.

---
Yuriy Babenko | Technical Consultant & Senior Developer
http://yuriybabenko.com

obiwan’s picture

But Personalized URL's is much more. As described, it serves up content based on the user's preferences, or often is used with direct mail or email campaigns to create personal pages - sometimes using subdomains - when users hit the page. An example is the EasyPURL.com service. I would also be interested in ways to accomplish this in Drupal 6.

tchronister’s picture

I've been doing the same thing regarding pURLs and Drupal. Pathauto was my very first homebaked approach to creating a pURL for a micro-site. The users were not logged in automatically though via the pURL, so not having the result of their actions tied to their other data in their profile was lame. With Pathauto, I had injected pURL list data for the campaign into the Drupal table for Pathauto using PhpMyAdmin so that all of the different pURLs aliased to the same landing page(s).

But the major item still left out is the login part whereby profile data is used.

Just this morning I looked at Login One Time http://drupal.org/project/login_one_time and began to map out on paper how this might work with that old Pathauto injection method and it's becoming hack central, so I decided to search pURL and see if anyone has come any farther with this effort - at least in an effort to see if I've missed anything.

If Login One Time allows us to determine the landing page and login the user at the same time, then the above Pathauto method would seemingly allow us to alias that landing page. OR perhaps use Panels whereby both the elements, such as the landing page content AND the Login One Time load and do their thing.

Hmmm, how about this ...the Panel Page is called via the Pathauto generated pURL alias, on the same panel the Login One Time page is loaded but only displays to anonymous users ...but since it logs them in, the Landing Page then displays because it only shows to authenticated users.

But what about the password? Future visits?

I'm dying to try this but I've run out of time today, my daughter will be waiting for me. ;)

davidw’s picture

Wow- I've got to follow this one. I just spent a half hour on the phone with a guy from easypurl.com, and then wondered if anyone has done the same thing with Drupal.
I will put my thinking cap on.

tchronister’s picture

Hey David! Turning to web dev since the Rock Mag folded?

openpayments.com’s picture

Anything started on the pURL front? We are definitely interested in this. Our purpose is mainly for response from a direct mail campaign. So, login for the pURL is not something we would most likely want. We would want the pURL to be generated in advance by loading data from an existing list of companies we would be sending a direct mail piece to.

tchronister’s picture

First, I know this process will be refined and eventually become a lot more efficient - I'm totally sharing this in case someone has insight to do so - but this worked for me on a small campaign.

1. Created a Landing Page, in my case I created its own page-node-250.tpl.php file but one wouldn't have to.

2. In the content of my Landing Page, I have a PHP block that does this;

<?php
$fullname = explode(".", ltrim($_SERVER['REQUEST_URI'],'/'));
$firstname = $fullname[0];
$lastname = $fullname[1];
echo "$firstname";

Which is used in the body of the page to display the name of the person - this value is gleaned directly from the Pathauto alias as pURL accomplished in step 3. It wouldn't be too much to add a table to your database then continue this PHP script with mySQL queries that return the array of variables specific to that user. Setting up the presentation is exactly like setting up a variable data print piece in something like Fusion Pro for instance.

3. Sourced my data list from our Mail Dept to generate my pURLs using /Firstname.Lastname and with Pathauto module installed, I used PHPMyAdmin's SQL tool to inject the whole list of aliases like this;

INSERT INTO `database_url_alias` (`pid`, `src`, `dst`, `language`) VALUES ('190', 'node/250', 'John.Smith', ''),
('191', 'node/250', 'Jim.Boyd', '');

Really, that's it in three steps. I know it's basic and compared to other Drupal work it's cumbersome, but compared to other web development it's pretty straight forward. Looking at it, I think a combination of the Data module and Views module would eliminate the extra steps and provide a means to manage this through the Drupal interface.

Some immediate things I don't like about this pURL method;
1. Not tied to the user database for the site, doing that, pre-populating WebForm info from the user Contact Information could be done better integrated with Drupal, not to mention roles.
2. Reportage! I need tracking/reportage suggestions for this. I use the Core Optional right now, and it is a crude start. Our Webforms that are populated by the user are good though as I have found a workaround for using $_SERVER['REQUEST_URI'] and have the pURL/alias show in in the submission data.
3. EasyPurl uses what they call Business Rules to handle actions on the page with the variable values, and I think much of that is done manually in this could be done using Views, Rules, etc. that is then available through the Drupal interface.

Feedback and collaboration welcome!

tricompat’s picture

Thanks tchronister,

I will have to give this approach a try. Unfortunately, it is still a temporary solution. There is obviously some demand in this, so maybe it would be worthwhile to start development of an actual module? It would be great to be able to:

1) Setup a user as a site admin (should have CVS import/export as well)
2) Somehow (through profile or a new module) assign content and fields to that user
2a)User groups should also come into play. Odds are many users can share content
3) Use a URL argument (username?) to pull the information defined above
4) Tracking to see who used the link

Much of this may very well exist, but unfortunately a lot of it doesn't, at least that I know. This would make a pretty sweet module!

Thoughts / ideas / concerns?

joshua.stout’s picture

this is a very elegant and simple solution. I like it. True: MySQL injections are probably not very user friendly but pretty easy to do for most Drupal developers.

awasson’s picture

This is an interesting topic.

My approach would be to harness and modify user profile pages with pathauto, token, etc... so that my profile would be example.com/users/awasson or perhaps example.com/awasson. I haven't checked to see how it reacts when I change the URL pattern to remove "users" but I don't see any reason why not.

Taking it a step further, I would use civiCRM or Drupal's Party CRM, RedHen, etc... so that I would have a real CRM on the back end to manage contact records and expose the fields I want to expose, allowing users to update and maintain the fields.

A few wants would be to set up the urls as subdomains so that my account would be at awasson.example.com. I haven't looked into that at all. Has anyone?

Also generating QR codes would be handy... Again, has anyone looked into this?

Further to that I would want to integrate some tracking. I suppose that could be handled via a custom module that creates a db table and tracks page impressions, referrers, etc...

Dawn Kasotia’s picture

I did a search for PURL (personalized URL) in Drupal and this discussion came up. It seems that most of the discussions about pURL and Drupal have to do with a different topic other than personalized URLs.

Has there been any further discoveries on using PURLs in Drupal?

I work for a company where I've created a micro-website (I've used both MindFire and Silverpop to do so) that's accessed when the customers' enter their PURLs in a web browser. Then each web page will have variable data and/or images for each customer that comes from a database. I'd like to find a way to use Drupal to do this instead of MindFire or Silverpop.

Also, "obiwan" describes what we're currently doing with MindFire and Silverpop and it would be great to use Drupal instead.

Pathauto does part of this
obiwan commented 5 years ago
But Personalized URL's is much more. As described, it serves up content based on the user's preferences, or often is used with direct mail or email campaigns to create personal pages - sometimes using subdomains - when users hit the page. An example is the EasyPURL.com service. I would also be interested in ways to accomplish this in Drupal 6.