Search code examples
javascriptiframeadobe-analytics

suppress omniture s.t() call from generating a "second" pageview in a site with iframe


I've already searched the answer for these, but my problem is with a site that has an iframe. The situation is: I've implemented de omniture tracking on a partner site (that a i don´t have control to modify) but the site has a iframe within and it makes the tracking script generate a second page view. is there a way to supress the omniture s.t() call from generating a "second" pageview in a site with iframe

best regards my friends and thanks for the help :D


Solution

  • I've been able to accomplish this with the following code:

    s.abort = self != top
    

    If self == top, you're not in an iframe and want the the pixel to fire s.abort = false

    If self != top you're in an iframe and want to stop the pixel s.abort = true

    Another way to accomplish this is:

    if(self != top)s.abort = true;