This documentation covers the methods for integrating content lockers with Rewarded Ads on your website.
If you have any questions or uncertainties, please contact your account manager — they'll be happy to assist you.
Standard triggering (recommended)
STEP 1: Include script
Insert following script into the head of your html file:
<script type="module" src="https://www.nuload.net/YOURDOMAIN_XY/ad.js"></script>
Before implementing both scripts in the header, check whether gpt.js
has already been included by a previous GPT integration.
If it has, there's no need to add it again. In that case, include only the second script.
STEP 2: Add the class nu-reward
to the element that should trigger the AD (content locker).
Custom event documentation
This documentation provides step by step instructions on how to implement custom event to start locker ad.
Custom event
To start locker AD using custom event, you need to dispatch a custom event with the name endAdEvent .
alert('Ad ended');
} } }));
Function breakdown
This line dispatches the custom event with the name endAdEvent
detail - This is the data that is passed to the event.
callback - This is the function that is called once user stops wathing the ad or when the ad is not available. You can pass in any function instead of alert('Ad ended'); .