1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Feature behind content locker

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

  1. qlithe

    qlithe Power Member

    Joined:
    Feb 14, 2012
    Messages:
    657
    Likes Received:
    96
    Hey

    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

    Joined:
    Feb 12, 2017
    Messages:
    5
    Likes Received:
    0
    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".