Export Script for Xandr AppNexus?

Hi :blush: Would it be possible to create an Export Script for Xandr AppNexus Standard Ads?

Specs:

Here is an example of how I have previously set this up. Not sure if this is 100% correct in relation to the specs above. However it has been working fine.

<!DOCTYPE html>
<html>
<head>

<meta name="ad.size" content="width=580,height=400">
<script type="text/javascript" src="https://acdn.adnxs.com/html5-lib/1.4.1/appnexus-html5-lib.min.js"></script>

</head>

<body>

<a href="javascript:void(0)" onClick="window.open(APPNEXUS.getClickTag(), '_blank');">
clickTAG
</a>

</body>
</html>

Cheers

A post was split to a new topic: Hype Template Export Script

@MaxZieb came up with a bit more of a DIY solution where you could probably craft this pretty easily using his export script and modifying the template file that he includes.

I've also gone ahead and put one together, since the instructions were not too complex.

There's one issue I've hit and I'm not sure if it is a configuration issue or a problem with the script - mainly that the APPNEXUS.ready() function is never called, therefore the click handler is never installed. It might be the case that using this their test/production environment will work, and just using it locally won't. You'll need to test.

(As a side note, I notice your HTML setup doesn't wait for the APPNEXUS.ready() call -- instead you just have the <a> tag use APPNEXUS.getClickTag() on clicks. I'd say there's a race condition where it might not actually be ready at that point, but practically I doubt this would happen, and the failure mode is likely the same anyhow!)

Please use these manual install instructions:


  1. Download the export script from:
    https://raw.githubusercontent.com/tumult/hype-export-scripts/AppNexus/AppNexus/AppNexus.hype-export.py
    (you may need to hit option-return in the browser to get the file to download)

  2. Open the /Applications/Utilities/Terminal.app and enter in this command:

    open ~/Library/Application\ Scripts/com.tumult.Hype4
    

    This will open the Applications Scripts folder; alternatively you can get to this via Hype's Preferences > Exporting > Show Export Scripts Folder in Finder

  3. Move the IABPoliteAd.hype-export.py file into the com.tumult.Hype4 folder

  4. Back in the Terminal, enter this command:

    chmod 755 ~/Library/Application\ Scripts/com.tumult.Hype4/AppNexus.hype-export.py
    

    This will give the export script permission to run.

It should be installed now. In Hype, you should be able to choose the File > Export as HTML5 > AppNexus… menu item.


Please let me know if this winds up working or not. If so, I can make an installer and publish. Thanks!

4 Likes

I can confirm this is working perfectly! Thank you very much :ok_hand::grin:

1 Like

Awesome, thanks! I'll package it up soon and have an official download.

I've moved the AppNexus export script into production on the export scripts page and made a package installer for it. You'll want to use this version and not the development one.

First delete your existing copy:

  1. Launch Hype
  2. In Hype's Preferences, click the Exporting tab and click Show Export Scripts Folder in Finder
  3. Enter into the com.tumult.Hype4 folder that shows up
  4. Move the AppNexus.hype-export.py file into the Trash

Then download and run the installer package:
https://static.tumult.com/hype/export-scripts/AppNexus/AppNexus.pkg

Let me know if you have any issues. Thanks!

Hi,

the media agency just made me aware that the ads are not clickable in terms of the URL added to their system does not open in a new tab in the browser. Nor does it open in the current tab.

For manual production I wrap all content inside an <a href>.

   <a href="javascript:window.open(window.clickTag)">	
content		
    </a>

Would it be possible to include something this in the script? Or something similar? :blush:

I would just add that exit function to a mouseclick event on an element. If you wrap everything with that function it wouldn't be possible to have interactive elements or video's etc.

I'd be curious if they could elaborate on the errors and issues which make them say this. We're following the standard ads guide pretty closely. This makes calls to the APPNEXUS click API, which I'd think would be desired for tracking purposes.

You're welcome to connect me with them and perhaps we can sort out a technical solution to follow the guidelines.

Otherwise we could change the export script to use the <a> tag wrapper pretty easily. The AxelSpringer ad already wraps the main content div in an <a> tag and the IABPoliteAd actually changes the main content div to an <a> tag itself.

I'd need some more details - in your original code you use:

<a href="javascript:void(0)" onClick="window.open(APPNEXUS.getClickTag(), '_blank');">

But your most recent post is:

<a href="javascript:window.open(window.clickTag)">

If it is the clickTag version, can you send more of a full ad so I can follow the way in which this should be extracted? (I can of course infer this, but it is easier to make sure I get it right from an ad that passes muster).

Hi Jonathan,

We have found that using the old .js the ad become clickable and opens a new window, when using the script.

Old:
https://acdn.adnxs.com/html5-lib/1.3.0/appnexus-html5-lib.min.js

New:
https://acdn.adnxs.com/html5-lib/1.4.1/appnexus-html5-lib.min.js

However the newer .js is working when set up like this:

<!DOCTYPE html>
<html>
<head>

<meta name="ad.size" content="width=580,height=400">
<script type="text/javascript" src="https://acdn.adnxs.com/html5-lib/1.4.1/appnexus-html5-lib.min.js"></script>

</head>

<body>

<a href="javascript:void(0)" onClick="window.open(APPNEXUS.getClickTag(), '_blank');">
Here comes my ad.
</a>

</body>
</html>

I will PM you the address the company receiving our ads :blush:

1 Like

Thanks - I'll message your contact.

In the mean time I've made variations in a branch that you're welcome to try. The basic instructions are similar to before, but now replace the production version with this:


  1. Download the export script from:
    https://raw.githubusercontent.com/tumult/hype-export-scripts/AppNexus/AppNexus/AppNexus.hype-export.py
    (you may need to hit option-return in the browser to get the file to download)

  2. Open the /Applications/Utilities/Terminal.app and enter in this command:

    open ~/Library/Application\ Scripts/com.tumult.Hype4
    

    This will open the Applications Scripts folder; alternatively you can get to this via Hype's Preferences > Exporting > Show Export Scripts Folder in Finder

  3. Move the AppNexus.hype-export.py file into the AppNexus folder within the com.tumult.Hype4 folder, replacing the existing script.

  4. Back in the Terminal, enter this command:

    chmod 755 ~/Library/Application\ Scripts/com.tumult.Hype4/AppNexus/AppNexus.hype-export.py
    

    This will give the export script permission to run.

It should be installed now, replacing the previous version. In Hype, you should be able to choose the File > Export as HTML5 > AppNexus… menu item.


Let me know if this works for you. Thanks!

1 Like

This seems to be working well​:ok_hand: Thank you very much! :grin:

2 Likes

Thanks for reporting back! I've posted the updated version on the Export Scripts page. (There's no need to update if you have the on I last posted on Dec 17.)

1 Like