Open jace opened 9 years ago
Idea: If the session was initiated by the promoter (campaign tag matches), don't charge for the impression. Tricky to implement if there are multiple active bids, or the referral link continues to send traffic long after an initial campaign has run.
Perhaps this will be easier if credits are for number of users reached rather than number of session-impressions, since our other metrics are all about users.
Flip side to charging for users: we cannot meaningfully charge for anonymous users, and one of the promotion opportunities is embedded listings on third party websites, where the likelihood of a logged in user showing up is very small. We'll have to charge for anonymous impressions there.
What about keyword targetting? (because exposing flags related to visibility to users, employers would confuse employers).
PinnedBid
implies the bid is for pinning alone. We may have other forms of bidding for visibility in future, including featuring on network sites, in email alerts and more. I propose renaming the model to just Bid
, with a bid_type
column indicating the bid is for pinning. The rest of this issue describes the framework required for pinning and so can remain as is.
As a temporary workaround for the Mar 19 comment above, since the Bid
model has a bid_type
column, we could have a "pin" type now that only charges for users, making anonymous impressions free (but selected by bid), while a future type could charge for impressions and so be suitable for use on third party websites.
We'll have to work out how we present this choice to employers placing bids.
Performance dependencies that need to be closed first: #309 and #318.
Performance dependencies that need to be closed first: #309 and #318.
Update: #318 is closed. #309 is not.
Promoted (pinned based on targeting criteria) listings on Hasjob require multiple components to be in place. First, assumptions:
To achieve this, we'll need the following models:
CreditTransaction
an increase or decrease of credits available to the user. The credit balance is always calculated as the sum of credit transactions. Transactions may have a financial value if linked to a payment gateway, but could also be grants from an admin, or could be system generated (free credits for signing up, etc).PinnedBid
is a bid for having a job pinned against target criteria. It's linked to aJobPost
, specifies a bid value (credits per impression, higher = greater chance of winning), has a start and end date, has aCreditTransaction
via which it is funded, and has acredit_balance
that's updated via a batch job. When the date expires and if there's any balance left, a secondCreditTransaction
refunds the balance to the user.JobImpression
gets a new foreign key toPinnedBid
that records when an impression was the result of a bid and a new boolean columnnot_anon
that containsJobImpression.event_session.user is not None
as a convenience cache value to make counting faster.New modelsUserJobView
andUserAnonView
get asession_count
column mirroringCampaignView
andCampaignAnonView
'ssession_count
.UserBidImpression
andAnonBidImpression
mirror the function ofCampaignView
andCampaignAnonView
, includingsession_count
columns. These are used to determine when aPinnedBid
should no longer be considered for a given user. Since counting is only triggered on an impression, a limit of two session-impressions per user will mean there will be at least one impression in a third session, with the pinned stickie disappearing immediately afterwards (sincesession_count
is no longer<= 2
). This is not good news for the bidder as it increments their session-impressions by one without receiving full visibility for that session. That makessession_count
harder unless we change thesession_count
update to trigger on session timeout (periodic cronjob) or new session creation (withinEventSession.get_session
).PinnedBid
's credit balance can drop below zero if session counting took too long to complete. This is okay and can be written off. If there is a positive balance after the end time expires, that's refunded.