1. #1
    Sencha User
    Join Date
    Aug 2012
    Posts
    6
    Vote Rating
    0
    anmartinez is on a distinguished road

      0  

    Default Click Tag on Ad

    Click Tag on Ad


    How do you apply a click tag on an ad for tracking purposes? I know in Flash you would typically create a blank button but how would you go about it in Animator.. Thanks for the help

  2. #2
    Sencha - Architect Dev Team
    Join Date
    Apr 2012
    Posts
    282
    Vote Rating
    23
    miro.bojic will become famous soon enough miro.bojic will become famous soon enough

      0  

    Default


    Hi,

    You can set up clickTag functionality in quite a similar way to how you would do it in Flash.

    First create a new rectangle object, and put it on top of all other objects in your project. Set the properties as follows:

    Border: turn it off.
    Width, height: match project width and height.
    Position: 0, 0
    Opacity: 0%

    Next, select the basestate of the object and under Actions->Click->Custom Javascript, you need to add script for clickTag functionality. There are probably many ways to do this, but this should work for basic cases:

    Code:
    //find if clickTag is set. First, we need to parse parameters that are passed and see if clickTag is set
    var parameters = window.location.search; //all parameters that are passed
    var clickTagIndex = parameters.indexOf('clickTag=');
    
    //only if there is clickTag defined, we do the following
    if(clickTagIndex > 0) {
      clickTagIndex += 9;
      var clickTag = parameters.substr(clickTagIndex); //extract the value behind clickTag
    
    
      //if there are multiple parameters other than clickTag, get the string only up to '&'
      if (clickTag.indexOf('&') > 0) {
          clickTag = clickTag.substr(0, clickTag.indexOf('&'));
      }
      //if clickTag is an actual link, open it in a new page
      if(clickTag.substr(0,5) === 'http:') {
          window.open(clickTag, '_blank');
      }
    }
    In Flash, when you embed an ad and set a clickTag, you typically want to do something like this:

    Code:
    <embed src="flash.swf?clickTag=http://www.someurl.com">
    Animator projects are usually embedded in iFrames. First, export your project for embedding (File->Other Export->Export for Embedding. Then you can embed your ad with clickTag into your page as follows:

    Code:
    <iframe src="ad.html?clickTag=http://www.someurl.com">