Q:

Tracking unauthenticated users in Django

I need to track unregistered users in my Django website.  This is for conversion optimization purposes (e.g. registration funnel, etc).  
A method I've used so far is using IP address as a proxy for user_id.  For various well-known reasons, this has led to fudged/unreliable results. 
Can I sufficiently solve my problem via setting a session variable at server-side?  An illustrative example would be great. 

For example, currently I have a couple of ways in my head.  One is doing request.session["temp_id"] = random.randint(1,1000000), and then tracking based on temp_id.  
Another is setting a session variable every time an unauthorized user hits my web app's landing page, like so:
if not request.session.exists(request.session.session_key):
    request.session.create()

From here on, I'll simply track them via request.session.session_key.  Would this be a sound strategy?  What major edge-cases (if any) do I need to be aware of? 

A:

Cookies are the simplest approach, but take into consideration that some users can have cookies turned off in their browsers. 
So for those users you can use javascript local storage to set some data.  This information will get deleted once you close the browser, but it's ok for funneling purposes.  Still others can have javascript turned off. 
Another approach would be to put custom data(key) in every link of the page when generating the template.  in other words you would have the session_id stored in html page and send through url parameters at click.  Something similar happens with csrf token.  Look into that. 