Nexx360 Documentation
  • Nexx360 solutions
  • Nexx360 account
    • Account creation
    • Account settings
      • Add and manage users
      • Configure bidders
      • Create blocklists
      • Implement throttling
  • General configuration
    • Introduction
    • Add and manage websites
    • Add and manage tagIds
    • Bid reductions
    • Cookie Sync script
    • Available bidders
  • Prebid Adapter
    • Introduction
    • Update Prebid with Nexx360 Adapter
    • Multiformat bids
  • VAST / CTV
    • Introduction
    • Create VAST Config
    • Build VAST ad tag
    • Connect the Google Ad Manager (GAM) account
    • Cookie Sync
    • Sample CTV Tag
  • Native
    • Introduction
    • Native Configs
    • GET
    • POST
    • Sample Response
  • Direct Call
    • Introduction
    • API Reference
    • Microsoft AST Example
    • Google Ad Manager Example
      • Connect the Google Ad Manager (GAM) account
  • AMP Nexx360
    • Introduction
    • Ad Server setup
    • Add rtc-config object to amp-ad units
  • OpenRTB
    • Introduction
    • Video Example
    • Mobile Example
    • Cookie Sync
  • Inapp
    • Introduction
    • Request Exemple
    • Google Ad Manager setup
  • API Management
    • Introduction
    • Connexion
    • Sites
      • Create a new site
      • Update site
      • Get Site
      • List Sites
    • TagIds (Stored requests)
      • Create a new tagId (stored request)
      • Update tagId (stored request)
      • Get tagId (Stored request)
      • List tagIds (Stored requests) by site
  • API Campaign
    • Introduction
    • Connexion
    • Orders
      • Create a new order
      • Update order
      • Get Order
      • List Orders
    • Line Items
      • Create a Line Item
      • Update Line Item
      • Get Line Item
      • List Line Items by Order
    • Creatives
      • Create a Creative
      • Update Creative
      • Get Creative
      • List Creatives by Line Items
  • Legacy - Direct call Nexx360
    • Introduction
    • Nexx Web features
      • Smart autorefresh
      • Incontent injection
        • Automated injection
        • Dynamic injection
      • Lazy Loading
      • Non-consent traffic monetisation
    • Integrate Nexx Web script on your site
      • Integration with GAM adserver
        • Nexx Web tag
        • Connect the Google Ad Manager (GAM) account
      • Integration with Xandr adserver
  • Nexx360 console
  • Nexx360 site
Powered by GitBook
On this page

Was this helpful?

  1. Direct Call

Microsoft AST Example

<!DOCTYPE html>
<html>
<head>
	<title>Test APNTAG</title>
  <!-- This is n360tag snippet, to be included in header -->
  <script>
  !function(){if(!window.n360tag){window.n360tag={init:function(){e("init",arguments)},fetchBids:function(){e("fetchBids",arguments)},setDisplayBids:function(){},targetingKeys:function(){return[]},que:[]};var n=document.createElement("script");n.async=!0,n.src="//cdn.nexx360.io/nexx360_direct_call.js";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(n,t)}function e(n,t){window.n360tag.que.push([n,t])}}();
  </script>


<script type="text/javascript">
   
    var apntag = apntag || {};       
    apntag.anq = apntag.anq || [];


     
    //load ast.js - async
    (function() {
       var d = document, e = d.createElement('script'), p = d.getElementsByTagName('head')[0];
       e.type = 'text/javascript';  e.async = true;
       e.src = '//acdn.adnxs.com/ast/ast.js';
       p.insertBefore(e, p.firstChild);
    })();


    apntag.anq.push(function() {
	    apntag.setPageOpts({
	        member: 6949,
          keywords: {toto: 'tata'}
	    })

      apntag.defineTag({
          invCode: "Lacentrale.desk_Annonces-HomePage_Banniere",
        sizes: [[320, 50], [728, 90], [1000, 90], [1000, 200], [1200, 90], [1200, 200], [1800, 1000], [1, 1]],
        targetId: "Banner",
        keywords: {toto: 'tata'},
      })

      apntag.defineTag({
        invCode: "Lacentrale.desk_Annonces-HomePage_Pave1", 
        sizes: [[300, 250], [300, 600]],
        targetId:  "Pave1",
      })
      console.log(apntag.getTag())
      apntag.onEvent('adLoaded', function(adObj,adError){
          console.log('adLoaded');
          console.log('[adObj]',adObj);
          console.log('[adError]',adError);
      })

      apntag.onEvent('adRequestFailure', function(adObj,adError){
          console.log('adRequestFailure');
          console.log('[adObj]',adObj);
          console.log('[adError]',adError);
      })

      apntag.onEvent('adBadRequest', function(adObj,adError){
          console.log('adBadRequest');
          console.log('[adObj]',adObj);
          console.log('[adError]',adError);
      })

      n360tag.init({
        currency: 'USD',
      });
      n360tag.fetchBids({
        slots: [
          {
            tagId: 'testnexx',
            divId: 'Banner',
            sizes: [[300, 600]]
          },
          {
            tagId: 'testnexx',
            divId: 'Pave1',
            sizes: [[300, 600]]
          }
        ],
      }, function (bids) {
        n360tag.setDisplayBids();
        apntag.loadTags();
      });
      setTimeout(() => {
        if(!n360tag.isReady){
          console.log('n360tag.IS_LOADED', n360tag.IS_LOADED)
          apntag.loadTags();
        }
      }, 1000);
    });
  </script>
    
</head>
<body>
	<h1>Test La Centrale</h1>

	<h2>Banniere</h2>
	<div id="Banner">
        <script type="text/javascript">
        apntag.anq.push(function() {
            //signal to script that this DOM element has been loaded and is ready to be populated with an ad
            apntag.showTag('Banner');
        });
        </script>
    </div>

    <h2>Pave1</h2>
	<div id="Pave1">
        <script type="text/javascript">
        apntag.anq.push(function() {
            //signal to script that this DOM element has been loaded and is ready to be populated with an ad
            apntag.showTag('Pave1');
        });
        </script>
    </div>

</body>
</html>

Creative

<script>
	var w = window;
	for (i = 0; i < 10; i++) {
		w = w.parent;
		if (w.n360tag) {
			try {
				w.n360tag.renderAd(document, "#{N360_ADID}");
				break;
			} catch (e) {
				continue;
			}
		}
	}
</script>
PreviousAPI ReferenceNextGoogle Ad Manager Example

Last updated 8 months ago

Was this helpful?