Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impressions and clicks are only recorded when the user has a session #8

Open
ataylor32 opened this issue Sep 28, 2017 · 0 comments
Open

Comments

@ataylor32
Copy link
Contributor

Oftentimes, anonymous users won't have a session. In that scenario, ads that are shown to them and ads that they click on won't be recorded. Django's SESSION_SAVE_EVERY_REQUEST setting won't help with this either. The render_ads_zone template tag and the AdClickView view both have this line:

if request.session.session_key:

That line could be replaced with something like this:

request.session['django-ads'] = True
request.session.save()

You could also have the app support both behaviors (if you wanted to) with a setting like ADS_SESSION_KEY. If it's a string, use the behavior I proposed above. If it's None, use the current behavior. Its default value could be 'django-ads'.

Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant