customisable counter
How do I get ad links to open in a new window / Questions / Discussion Area - Trafficspaces Support

How do I get ad links to open in a new window

mmcomber's Avatar

mmcomber

15 Mar, 2011 09:09 PM via web

Hello,

Is there an ability to set _blank as the default for an ad zone, so when someone clicks on the ad it opens in a new window?

If there is, I'm not seeing it.

Thanks!

  1. Support Staff 2 Posted by Niyi on 15 Mar, 2011 10:23 PM

    Niyi's Avatar

    To get ads to show in a new window, add the following code before your final ad call i.e. FetchAds();

    <script language="Javascript">
        TS_AdService.targetFrame = "_blank";
        TS_AdService.FetchAds();
    </script>
    
  2. 3 Posted by mmcomber on 16 Mar, 2011 07:33 PM

    mmcomber's Avatar

    Thank you! I placed the script right about the final call in my footer. (I
    used the advanced tag set up). All of the ads in my sidebar now open in a
    new window. Strangely, though, the ad in the masthead of the site still
    opens in the same window.

    Thoughts?

    On Tue, Mar 15, 2011 at 3:23 PM, Niyi <
    ***@tenderapp.com> wrote:

  3. 4 Posted by mmcomber on 16 Mar, 2011 10:24 PM

    mmcomber's Avatar

    Sorry, just noticed another issue. Turns out that when I added the code,
    those sidebar ads no longer appeared in IE 8, but displayed fine in Firefox.

    Thoughts?

  4. Support Staff 5 Posted by Niyi on 18 Mar, 2011 07:52 PM

    Niyi's Avatar

    I noticed the first two ad calls on your page are TS_AdService.DisplayZone whilst the rest are TS_AdService.CreateZone calls.

    This will explain why the ad in the masthead didn't use the target frame. The DisplayZone call fetches the ad immediately before the target frame was set.

    Can you try replacing all the ad calls with CreateZone instead?

  5. 6 Posted by mmcomber on 18 Mar, 2011 08:40 PM

    mmcomber's Avatar

    Thanks for catching that. Not sure why the code was different.

    In implementing your original suggestion, I found that if I placed the code
    before the final ad call, it worked in Firefox (ads opened in a new window),
    but the ads did not display at all in IE8. However, if I replaced the final
    ad call with that code, it worked just fine on both platforms.

    Is this the right approach? Is having a separated final ad call necessary?

    Thanks,

    Marty

    On Fri, Mar 18, 2011 at 12:52 PM, Niyi <
    ***@tenderapp.com> wrote:

  6. Support Staff 7 Posted by Niyi on 22 Mar, 2011 01:12 PM

    Niyi's Avatar

    Hi Marty,

    When you have multiple ads on a single page, we recommend that you use the TS_AdService.CreateZone calls followed by a single TS_AdService.FetchAds call.
    The former defines the position of the ads whilst the latter makes the actual call to fetch all the ads. It's faster, more efficient, speeds up page loads, and reduces conflicts.

  7. 8 Posted by veepiz on 23 Mar, 2011 05:55 AM

    veepiz's Avatar

    original question... except that i use iframes

  8. Niyi closed this discussion on 23 Mar, 2011 11:52 AM.

  9. mmcomber re-opened this discussion on 25 Mar, 2011 11:14 PM

  10. 9 Posted by mmcomber on 25 Mar, 2011 11:14 PM

    mmcomber's Avatar

    Sorry, Niyi, but I'm slightly confused.

    here's basically what I have in order for calls on my page:

    In my <head> I have:
    <script src="http://ads.trafficspaces.net/v1.22/adservice.js"
    type="text/javascript"></script>

    On the main page I have eight calls for separate ad zones, similar to this
    one:

    <script
    language="Javascript">TS_AdService.CreateZone("MDEyMzQ0MTYxNTQzMjE=");</script>

    And then in the footer I have the code you suggest for opening the ads in a
    new broswer:

       <script language="Javascript">
           TS_AdService.targetFrame = "_blank";
           TS_AdService.FetchAds();
       </script>

    My question is under this last bit of code, do I need to add this:
    <script language="Javascript">TS_AdService.FetchAds();</script>

    Or can I leave that out?

    On Tue, Mar 22, 2011 at 6:12 AM, Niyi <
    ***@tenderapp.com> wrote:

  11. Support Staff 10 Posted by Support Guru on 01 Apr, 2011 02:16 PM

    Support Guru's Avatar

    There should only be one call to TS_AdService.FetchAds() so adding it again is unnecessary.

  12. Support Guru closed this discussion on 01 Apr, 2011 02:16 PM.

  13. mmcomber re-opened this discussion on 01 Apr, 2011 06:52 PM

  14. 11 Posted by mmcomber on 01 Apr, 2011 06:52 PM

    mmcomber's Avatar

    Thanks much. That's what I figured.

    On Fri, Apr 1, 2011 at 7:16 AM, Support Guru <
    ***@tenderapp.com> wrote:

  15. Support Guru closed this discussion on 02 Apr, 2011 01:40 PM.

Comments are currently closed for this discussion. You can start a new one.

Recent Discussions

25 Apr, 2012 05:25 PM
08 May, 2012 08:34 PM
02 May, 2012 11:13 PM