Feature behind content locker

Discussion in 'Scripting' started by qlithe, Feb 11, 2017.

  1. qlithe

    qlithe Power Member

    Feb 14, 2012
    Likes Received:

    I'm planning to use a content locker to lock some different features. Let's say you complete a survey, and then get the option to get some free followers or any kind of reward. Submit a form basically.

    How would I go about to make sure that they can only submit the form once, after completing the survey?
  2. joosrule

    joosrule Newbie

    Feb 12, 2017
    Likes Received:
    You just need some form of tracking.
    I'm assuming you are working with an advertiser/3rd party site. Because if everything goes through your own backend this is rather trivial. Just redirect them to the needed place once the survey is completed. Otherwise, you will need to embed a footprint into the survey submit request. For example an ip + session hash, then once the survey is validated by the 3rd party they would presumably postback an event to your backend containing that same ip + session hash. At the same time have a function on the frontend that polls your backend for completion status. You would then query your internal store (could be a database, key-value store, could be a flat file for all you care), find the right user and redirect them if status == "completed survey".