Guides
Log In
Guides

Taboola Subscription Pixel

Overview

By default, Taboola Newsroom allows you to view article performance based on page views. However, subscriptions are increasingly becoming an important metric for subscription-minded publishers.

By installing the Taboola Subscription Pixel, you can use Taboola Newsroom to:

  • View article performance based on the total number of subscription events for a given article.

    (A last-touch model is used to attribute conversions.)

  • Filter performance stats based on the user type (e.g. subscriber, registered user or guest).

Integration overview

This section provides a high-level overview of the integration process. Specific instructions follow in the sections below. (See: Setup)

Pass user data

Data is passed via the Taboola command queue (_taboola)

On each page that potentially triggers a subscription funnel - e.g. article pages, home page and section front:

  1. Pass the user data - e.g. user_type, etc.
  2. For a premium article, set the premium flag to true.

Pass subscription funnel data

Data is passed via the Taboola subscription pixel (_tfa)

On each page within the subscription funnel (e.g. the form submission page):

  1. Pass the subscription funnel data - e.g. the name (aka status) of the subscription funnel, etc.

The user session

As a visitor moves through different stages of their user session, pass the relevant value for user_type:

📘

user_type

  • User is not logged in => pass 'guest'
  • User registers => pass 'registered'
  • User is logged in => pass either 'registered' or 'subscriber' (depending on the user's account status)

Setup

Articles & front pages (user data)

For articles (regular or premium), home page and section fronts:

  1. Confirm that the page already contains the Taboola loader and placement tags.

    These scripts are present for any pages with Taboola recommendations. For more information, see Standard (JS) or SPA.

  2. If your page does not the above scripts, make sure to implement Invisible Widgets.

    (For example, you might not be showing Taboola recommendations on your premium pages.)

  3. Within the loader tag (before loader.js), invoke _taboola.pushand pass the user data.

    (Refer to the 2 code samples below.)

  4. If this is a premium article, invoke _taboola.push (again) and set the premium flag to true.

    (Refer to the 2 code samples below.)

// Within the loader tag (before loader.js)...
window._tfa = window._tfa || [];

// Replace each <placeholder> with the actual value, *without* angle braces:
_taboola.push({unified_id:'<internal_user_id>', user_type:'<user_type>', paywall:<boolean_value>});
// Within the loader tag (before loader.js)...
window._tfa = window._tfa || [];

// Replace each <placeholder> with the actual value, *without* angle braces:
_taboola.push({unified_id:'<internal_user_id>', user_type:'<user_type>', paywall:<boolean_value>});
// Within the loader tag (before loader.js)...
window._tfa = window._tfa || [];

_taboola.push({unified_id:'973dfe463ec85...13b', user_type:'subscriber', paywall:true});

// For a premium page:  
_taboola.push({premium:true});

📘

Params

unified_id - Your internal identifier for this user - e.g. a hashed email.

user_type - Possible values:'subscriber', 'registered', 'guest' or 'other'.

paywall - If a paywall is displayed for this page, pass true. (Default is false)


Replace each <placeholder> with the actual value - without angle braces.

Lazy-loaded pages

If your pages are lazy loaded (and you cannot push the unified_id and user_type variables to _taboola), add the following JS variables with global scope:

<script type="text/javascript">
    _tbl_unified_id = '<internal_user_id>'
    _tbl_user_type = '<user_type>'
    _tbl_paywall = <boolean_value> //If a paywall is present, pass `true`. (Default is `false`)
</script>

Subscription pages (Subscription funnel data)

For each page in the subscription funnel, run the following script inside the <head> tag.

Refer to the 2 code samples provided

<script type='text/javascript'>
 // Insert on each page in the subscription funnel. 
 // Refer to the examples (next tab) and the 'Params' callout (below).
 window._tfa = window._tfa || [];
 window._tfa.push({notify: 'subscription', name: 'subscription-form-visible',sourceurl: '<article url>'});
 !function (t, f, a, x) {
 if (!document.getElementById(x)) {
 t.async = 1;t.src = a;t.id=x;f.parentNode.insertBefore(t, f);
 }
 }(document.createElement('script'),
 document.getElementsByTagName('script')[0],
 '//cdn.taboola.com/libtrc/unip/<pub id>/tfa.js',
 'tb_tfa_script');
</script>
<script type='text/javascript'>
 // Insert on each page in the subscription funnel. 
 // Refer to the examples (next tab) and the 'Params' callout (below).
 window._tfa = window._tfa || [];
 window._tfa.push({notify: 'subscription', name: 'subscription-form-visible',sourceurl: '<article url>'});
 !function (t, f, a, x) {
 if (!document.getElementById(x)) {
 t.async = 1;t.src = a;t.id=x;f.parentNode.insertBefore(t, f);
 }
 }(document.createElement('script'),
 document.getElementsByTagName('script')[0],
 '//cdn.taboola.com/libtrc/unip/<pub id>/tfa.js',
 'tb_tfa_script');
</script>
<script type='text/javascript'>
 // For the 'Thank You' page:
 window._tfa = window._tfa || [];
 window._tfa.push({notify: 'subscription', name: 'subscription-completed',sourceurl: 'https://example.com/news/article1.html'});
 !function (t, f, a, x) {
 if (!document.getElementById(x)) {
 t.async = 1;t.src = a;t.id=x;f.parentNode.insertBefore(t, f);
 }
 }(document.createElement('script'),
 document.getElementsByTagName('script')[0],
 '//cdn.taboola.com/libtrc/unip/123/tfa.js',
 'tb_tfa_script');
</script>

📘

Params

  • name - possible values:
    • 'subscription-form-visible'- for all pages in the workflow, before the 'Thank you' page.
    • 'subscription-completed'- for the 'Thank you' page.
  • sourceurl - the canonical URL of the article (or other page) that triggered the subscription funnel.
  • pub_id- Your numeric account ID, as provided by Taboola.

    See the code snippets that were mailed to you - or reach out to your Taboola Account Manager.

Next steps

Once your integration is complete, follow the guidelines below to verify your integration.

See: Pixel Verification