Answer to unlock content


  1. Register your website (if you haven't)
  2. Register an ad unit of type QA+Banner ( 320 x 250 )
  3. Integrate below mentioned JS code snippet in the head section of your webpage where you wish to display the unit
    <head>
    ...
    <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
    <script type="text/javascript">
    // Here "addEventListener" is for standards-compliant web browsers and "attachEvent" is for IE Browsers.
    var eventMethod = window.addEventListener ? "addEventListener" : "attachEvent";
    var eventer = window[eventMethod];
    var messageEvent = eventMethod == "attachEvent" ? "onmessage" : "message";
    
    //Listen to message from tq iFrame
    eventer(messageEvent, function (e) {
    	console.log("Got message from tq");
    	if (e.origin == 'http://adserver.tapcliq.com') {			
    		if(e.data == "change") {
    		   window.document.getElementById('tqframe').parentNode.focus();
    		}
    		else if(e.data.startsWith("opSelected")) {
    		
    		}
    		else {
    		  closeMe(e.data);
    		}
    	}
    }, false);  
    </script>
    <script type="text/javascript">
    var tq_appid = "1dd2fabc217542cf8ad093eee3ab677e";  // replace it with your registered website id (app id)
    var tq_tags = "";  // You can add multiple comma separated content based tags
    var tq_adunitid = "156";  //replace it with your registered ad unit id
    var tq_adheight = "250";   
    var tq_adleft = "300";  // (optional) distance from left of the screen for the frame
    var tq_adbottom = "0";  // (optional) distance from bottom of the screen for the frame
    var userId;
    </script>
    <script type="text/javascript" src="http://adserver.tapcliq.com/adserver/rest/resources/js/showtqad.js"></script>
    ...
    </head>					
  4. Create a QA+Banner campaign targeted to your website with appropriate tag(s). Note: Use the tag that you mention here in the code snippet above
  5. Add your code to unlock the content under else if (mentioned in red in the code snippet)
    else if(e.data.startsWith("opSelected")) {
    	closeMe	
    }		    			

Back to Top