Setting up Moments (including event triggers)

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

  1. Go to your app / website in which you wish to capture user actions and set up triggers - under My Apps which is under My Properties on left hand panel.

  2. Click on "Capture moment (i.e., an event or action performed in your app / website)" and select from default moments (events) OR add your custom moment (event)– example below shows - adding a custom moment – called "Product Selection" moment

  3. Newly created moment is displayed along with any previously created moments of your app / website

  4. Click on "View" code snippet corresponding to the newly added momentto get it's code-snippet
  5. Put this code-snippet in your app where this moment (i.e., event) occurs in order to capture it. In our example,in order to capture "Product Selection" moment, add the code snippet where the product is selected

For iOS:

-	(void) productSelected: (id)sender {   
if (tqAdView != nil) 
	[tqAdViewrecordMoment::@"Product Selection" momentAttributes:[[NSDictionarydictionaryWithObjectsAndKeys: @"Product Name", @"Running Shoes", @"Brand", @"Nike"]; 


  • tqAdView: Variable that refers to your existing ad view
  • momentAttributes: Nil or nsdictionary of moment details with maximum 3 key-value pairs



For Web SDK -JS (if yours is a website):


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=""></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 == '') {			
		if( == "change") {
		else {
}, false);  
<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 type="text/javascript" src=""></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");

getTqAd Parameters are: ("ad_height", "coordinate_from_left", "coordinate_from_bottom", "your_registered_ad_unit_id_for_this_ad_size", "moment_name")

Back to Top