Referral generation and tracking

Here are two things that need to be done.

1. Generate Referreal URL's for users.
-- people will signup and a referral URL will be generated for them,
which they can share

2. Track those referral URL's
-- I will have to track performance of each referral URL

How can go about doing this using Rails 3.1

Should sessions be used to track referral URL's ??

When a user accesses my facebook app via http://apps.facebook.com/myappxxxxx, I want it to immediately show the request permissions fb dialog - like so many others do.

The problem is that it shows a big facebook icon instead of the request permissions. However, if you click on that icon, it in fact goes to the correct request permissions page!

Does anyone know how to redirect to the facebook permissions page properly?

When a user accesses my facebook app via http://apps.facebook.com/myappxxxxx, I want it to immediately show the request permissions fb dialog - like so many others do.

The problem is that it shows a big facebook icon instead of the request permissions. However, if you click on that icon, it in fact goes to the correct request permissions page!
Does anyone know how to redirect to the facebook permissions page properly?

not ideal but you can always use javascript to click the facebook image on page load.

I think the reason that you have had no replies is that your question
is much to general and vague.

Can I ask how much experience you have with Rails? If you are a
beginner and have not yet done so then I suggest that you work through
some detailed tutorials to get a grasp of the variety of features
availble. I don't just mean skim through but work right through
making sure you understand everything. Then you should be able to
answer most questions yourself. railstutorial.org is good and free to
use online.

If you are not a beginner then try and explain in more detail what you
are trying to do, and explain the bits of it that you are having
difficulty working out how to implement. However it is best to try
and keep to just one question per thread as otherwise it all gets
confusing. So sit down, work out what you want to do and pull out the
key question that you need help with.

Colin

I'm not really a expert. Advanced begineer you can say.

I'll elaborate a bit.

1. Generate referral URL's

A user signs up and user is given a referral URL e.g. www.mysite.com/435
, where 435 is the refer ID. This URL can be shared by the user.

2. Tracking referral URL's

Now I want to be able to track how many people have clicked no
www.mysite.com/435 and how many have signed up using a particular
referral URL

I want some suggestions regarding how do I construct my model and
controllers.

Please don't top post it makes it difficult to follow the thread.
Insert your reply at appropriate points in the previous message.
Thanks.

I'm not really a expert. Advanced begineer you can say.

I'll elaborate a bit.

1. Generate referral URL's

A user signs up and user is given a referral URL e.g. www.mysite.com/435
, where 435 is the refer ID. This URL can be shared by the user.

You are talking about referrals so possibly you want a Referral model.
Then the /435 above is the referral id and the url will go to the
show for that referral.

2. Tracking referral URL's

Now I want to be able to track how many people have clicked no
www.mysite.com/435 and how many have signed up using a particular
referral URL

Possibly increment a column in the referral object each time someone
goes there and a different one if they sign up using it.

Use top.location, not window.location.

In which place I have to use top.location .
I am using gems
gem 'omniauth', '>= 0.2.6'

>> Does anyone know how to redirect to the facebook permissions page properly?
> Use top.location, not window.location.

In which place I have to use top.location .
I am using gems
gem 'omniauth', '>= 0.2.6'

I'm not sure how to do it using omniauth. In my apps I do it manually,
having code like this:
top.location.href = "https://www.facebook.com/dialog/oauth?
scope=publish_stream&client_id=<%= fb_app_id %>&redirect_uri=<%= url
%>"

If I change top.location to window.location, only inner frame gets
redirected, having FB chrome around it, and resulting in that big FB
logo, which clicked indeed redirect me to the target page.