In order to - a) Capture an event or user action – i.e, pages they visit, buttons clicked or any other action performed and b) Set up triggers to automatically engage users at those moments, you need to
- (void) productSelected: (id)sender { ... if (tqAdView != nil) { [tqAdViewrecordMoment::@"Product Selection" momentAttributes:[[NSDictionarydictionaryWithObjectsAndKeys: @"Product Name", @"Running Shoes", @"Brand", @"Nike"]; } ... }
NOTE:
NOTE:
Call this function only after mentioning scripts mentioned below in <head> of your webpage. By default ad frame is added on page load but will be removed after the ads are done displaying
<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 tqiFrame eventer(messageEvent, function (e) { if (e.origin == 'http://adserver.tapcliq.com') { if(e.data == "change") { window.document.getElementById('tqframe').parentNode.focus(); } else { closeMe(e.data); } } }, false); </script> <script type="text/javascript"> var tq_appid = "c6048b1b78c549509c43596492409884"; // replace this with your registered appId for the website var tq_tags = "lifestyle,news"; // You can add multiple comma separated content based tags - this is important as ad campaigns are delivered based on these tags var tq_adunitid; var tq_adheight; var tq_adleft; // (optional) distance from left of the screen for the frame var tq_adbottom; // (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> <script type="text/javascript"> ... //Your code that detects occurrence of below mentioned moment. When the moment occurs call getTqAd with moment name as the last paramater. getTqAd("50","0","0","186","Product Selection"); ... </script> getTqAd Parameters are: ("ad_height", "coordinate_from_left", "coordinate_from_bottom", "your_registered_ad_unit_id_for_this_ad_size", "moment_name")