Installation

Prerequisites

In order to implement our Web Offerwall, you will need to implement the Self Managed Currency postback. Please also create an app via our publisher dashboard in order to access your SDK key.

SDK Flow

The SDK needs to connect and validate the current user before we render the offerwall. This is to ensure

image

Adding SDK Snippet

Add this snippet to your HTML Code. By adding this snippet.

<script>
  (() => {
    var t, a, p, j, o, y;
    (t = window),
      (a = document),
      (p = 'https://webofferwall.tapjoy.com/sdk/latest'),
      'function' == typeof t[(j = 'Tapjoy')]
        ? t[j]('activator-reinitialized')
        : ((t[j] = function () {
            (t[j].q = t[j].q || []).push(arguments);
          }),
          (t[j].l = 1 * new Date()),
          (o = a.createElement('script')),
          (y = a.getElementsByTagName('script')[0]),
          (o.async = 1),
          (o.src = p),
          y.parentNode.insertBefore(o, y));
  })();
</script>

The SDK can be used anywhere after this snippet. See below for an initialization example:

<script>
  Tapjoy('init', {
    sdkKey: '<SDK_KEY>',
    publisherUserId: '<USER_ID>',
    eventName: '<PLACEMENT_NAME>', // default is '#WebOfferwall'
  });
</script>

Prefetching

By default, webofferwall is being preloaded on every sdkKey / publisherUserId change.

You can stop prefetching the offerwall by adding preload argument to your init call

Tapjoy('init', {
    ...,
    preload: false,
})

If you want to preload later in the process, you can always call preload method.

Tapjoy('preload');