CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • Site personalization based on contact info
Pages: [1]

Author Topic: Site personalization based on contact info  (Read 2270 times)

unclejustin

  • I post occasionally
  • **
  • Posts: 38
  • Karma: 2
  • CiviCRM version: 4.3.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.5
  • PHP version: 5.3.6
Site personalization based on contact info
May 29, 2008, 11:23:06 am
So here's what we currently do, and I am trying to replicate with CiviCRM + Drupal.

We send out emails to prospects with personalized urls (purls) such as www.example.com/JohnDoe. The link identifies them and triggers various personalizations throughout the site. Nothing sensitive, just greeting messages like "Hi John," and if we have some business rules in place we will show different content based on interest. Now when the prospect goes to a page that would have pre-populated sensitive information like an update contact info form, or register for an event with their info pre-populated, we then ask for a password to authenticate that they are who they say they are. Currently, if this is their first visit we send a new password out to them, and they login with that.

What I'm thinking is. I can import contacts into CiviCRM. If I can find away to grab their info and use it on page that will work for the personalizations. I can use drupal authentication to restrict sensitive areas, and piggy back drupal's sign up workflow to handle the new password and authentication from there.

For my reports I could just compare the drupal and civi dbs to see how much throughput we're getting from the emails.

So. I guess what I'm looking for is thoughts on this. Anyone else out there do something similar already? I'm not sure where to start really about making this happen. Any pointers are greatly appreciated.

Thanks!
-justin
-justin

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: Site personalization based on contact info
May 30, 2008, 06:56:28 am
hey justin,

i might not be clear on exactly what you're asking, but couldn't you do the following:

1. Import your contacts into CiviCRM.
2. Create your CiviCRM profile or event registration pages.
3. Edit your Drupal new user welcome email to have the right link in it. (or you can manually send welcome email obviously).
4. Create Drupal users with the same email addresses (which will hook up the CiviCRM contacts with the Drupal user id) and have it send the welcome email (or manually create your welcome emails instead).
5. Sync your drupal and CiviCRM contacts in CiviCRM > Administer CiviCRM
6. The link in the email directs them to the page you want (with the profile or event reg on it) and which is restricted to authenticated users. Thus, when they initially go to that page they will be forced to log in. Once they log in, they will be directed to the page and the CiviCRM info will autopopulate since their drupal user and civicrm contact info is synced.

hope that helps,
emily

unclejustin

  • I post occasionally
  • **
  • Posts: 38
  • Karma: 2
  • CiviCRM version: 4.3.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.5
  • PHP version: 5.3.6
Re: Site personalization based on contact info
May 30, 2008, 07:22:33 am
Thank you so much for the reply emily. That's exactly what I'm asking for, just a nudge in the right direction. I have already imported some contacts to CiviCRM, and the rest of your steps will get 80% of the way to where I need to be. I wonder if I can auto-sync the contacts to drupal when a new drupal user is created. I'm sure you can, since it's just a php script. The only bit of weirdness for me is the "identified" vs "authorized".

I'm trying to find a way to pull contact info using the url as the search parameters. I guess I can store what info I need in global vars. How I did this under my current system is build a custom 404 page that parses the URL to extract the username. Then I pull the info I need from the DB and put them into session variables. I suppose a similar approach should work here as well. The only downside is that if a user tries to pull a reall 404, like a missing image, the system tries to lookup a user with the image name. It gets pretty messy and I was never very happy with the solution.

Thanks again for your help!
-justin

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: Site personalization based on contact info
May 30, 2008, 07:34:25 am
Hmm...I guess I don't really see the whole picture here. I am assuming you really need to do personalized urls vs just a single page that will automatically populate with contact info of the right user (once they log in)?

I don't know if this would be helpful, but have you looked at http://drupal.org/project/path_redirect ?

If you really need to do purls, then you could use this mod to have them all redirect to the civicrm profile/event page, and you wouldn't have the issue of going through the 404. Of course, the final url would not look like their name as the downside, but in the email it would look good. The only other thing is I don't know how many users we're talking about, so you might have to write a script to automate the path_redirect module.

unclejustin

  • I post occasionally
  • **
  • Posts: 38
  • Karma: 2
  • CiviCRM version: 4.3.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.5
  • PHP version: 5.3.6
Re: Site personalization based on contact info
May 30, 2008, 11:09:59 am
First thanks again for your input. I'm going to keep posting my findings here just in case anyone else has a similar need.

So far I have www.example.com/username working using a slightly modified version of PathAuto so that it brings you to the user logon instead of just showing the "not authorized" page. This will create my url aliases for me after I import my users.

Now I'm working with Persistent Login to see if I can have it auto-set the cookie. It already comes built in with a feature to force the user to log in via the form when certain pages are hit, which is exactly what I'm looking for. If I can parse out the username from the url and auto-set that cookie I think this will be just what I was looking for.

Then I will see if I can get the Drupal User Import module and the CiviCRM Import functionality to play together, so that I can upload both at the same time.

And finally, see if I can get page view information onto the CiviCRM dashboard. That will get me a good 95% of the way towards where I want this project to be, which is amazing to me considering how little time I've put in already.
-justin

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Site personalization based on contact info
May 30, 2008, 02:59:45 pm
A few other "tips" that might help (altho I'm not sure I have a complete understanding of what you've done so far..).

Quote
We send out emails to prospects with personalized urls (purls) such as www.example.com/JohnDoe.
If you're using CiviMail to send these mailings - you may be able to use contact "tokens" to personalize the URL for each recipient. Check out this documentation:

http://wiki.civicrm.org/confluence/display/CRMDOC/Mail-merge+Tokens+for+Contact+Data

Quote
I wonder if I can auto-sync the contacts to drupal when a new drupal user is created. I'm sure you can, since it's just a php script. The only bit of weirdness for me is the "identified" vs "authorized".

CiviCRM does this automatically after it's enabled in Drupal. Each time a new user registers, a "linked" CiviCRM contact record is created (or, if there's already a CiviCRM contact w/ a matching primary email address - then the new user record is "linked" to the existing CiviCRM contact record). BTW - these linkages are maintained in your CiviCRM DB in civicrm_uf_match table.
Protect your investment in CiviCRM by  becoming a Member!

unclejustin

  • I post occasionally
  • **
  • Posts: 38
  • Karma: 2
  • CiviCRM version: 4.3.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.5
  • PHP version: 5.3.6
Re: Site personalization based on contact info
May 30, 2008, 03:36:16 pm
Quote from: Dave Greenberg on May 30, 2008, 02:59:45 pm
If you're using CiviMail to send these mailings - you may be able to use contact "tokens" to personalize the URL for each recipient.

Good to know. We're not going to be using CiviMail, maybe for smaller runs, but generally we use a vendor.

Quote from: Dave Greenberg on May 30, 2008, 02:59:45 pm
CiviCRM does this automatically after it's enabled in Drupal. Each time a new user registers, a "linked" CiviCRM contact record is created (or, if there's already a CiviCRM contact w/ a matching primary email address - then the new user record is "linked" to the existing CiviCRM contact record). BTW - these linkages are maintained in your CiviCRM DB in civicrm_uf_match table.

That's great info. Initially I'm using CiviCRM's import functionality to bring in the contacts. Then I'll use Drupal's import module to do the same on that same csv file. If that triggers the sync up then awesome! The next step would be to script it up to just run one right after the other to save me a step.

Thanks!
-justin

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • Site personalization based on contact info

This forum was archived on 2017-11-26.