Skip to main content

Signalsight Conversion API

Transition Document

Introduction

This guide will explain how you can quickly and easily implement Conversion API to your source code using Signalsight

Attention Please!

While adding the events bellow please remove all of the fbq calls, but leave the facebook loading code.

For example, remove the following code block:

<script>
  fbq('init', 'your-pixel-id');
  fbq('track', 'PageView');
</script>

Events

Please implement the following events in your website:

  1. Loading Code and Page View Event
  2. View Content Event
  3. Custom Special Event
  4. Search Event
  5. Add To Cart Event
  6. Initiate Checkout Event
  7. Purchase Event
  8. Lead Event
  9. Complete Registration Event
  10. Contact Event

1. Loading Code and Page View Event

To take full advantage of ZZGate Signal the Facebook loading code must be placed at the top of every page, just before the Signalsight code. Make sure, however, to remove the facebook event including PageView to prevent duplicate events:

<!-- Facebook Pixel Code -->
<script>
  !function(f,b,e,v,n,t,s)
  {if(f.fbq)return;n=f.fbq=function(){n.callMethod?
  n.callMethod.apply(n,arguments):n.queue.push(arguments)};
  if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
  n.queue=[];t=b.createElement(e);t.async=!0;
  t.src=v;s=b.getElementsByTagName(e)[0];
  s.parentNode.insertBefore(t,s)}(window, document,'script',
  'https://connect.facebook.net/en_US/fbevents.js');
</script>
<!-- End Facebook Pixel Code -->

At the top of every page immediately after the Facebook pixel loading code please place the following Signalsight code. This will allow you to send events using Signalsight:

<!-- BEGIN Signalsight Loader Code -->
<script language="JavaScript" type="text/JavaScript">
  window.p2sq = window.p2sq || [];
  p2sq.push({et:'Init',p:{
    em: '{user-email}',         // Parameters
    fn: '{user-first-name}',    // encrypted
    ln: '{user-last-name}'      // with SHA-256
    // ...
  }});

  p2sq.push({et: 'PageView'});  // Page View Event

  !function(f, b, e, v, t, s) {f.p2sq = f.p2sq || [];if (f.p2sf) return;f.p2sf=true;
    t = b.createElement(e);t.async = !0;t.src = v;s = b.getElementsByTagName(e)[0];
    s.parentNode.insertBefore(t, s);
  }(window,document,'script','https://cpi.ssevt.com/js/v4.2/your-p2s-key');
</script>
<!-- END Signalsight Loader Code -->

Parameter List

User informationParameterFormatExample
E-MailemLowercase + SHA256 Hashjohn@doe.com
First NamefnLowercase + SHA256 Hashjohn
Last NamelnLowercase + SHA256 Hashdoe
TelephonephOnly numbers including country and area code + SHA256 Hash12125357525
GendergeA single lower case letter f or m + SHA256 Hashf
BirthdaydbOnly numbers, birth year followed by month and day + SHA256 Hash19910526 for May 26, 1991
CityctLowercase and without spaces + SHA256 Hashnewyork
Postal Code / Zip CodezpOnly Numbers + SHA256 Hash34000
CountrycnTwo letter country code, lowercase + SHA256 Hashtr

Client Side SHA256 Hashing

If you cannot hash the personally identifiable information (PII) you may do it on the client side. To accomplish this load the following script at the top of every page on your website, before the ZZGate Signal loading code:

<script src="https://cdnjs.cloudflare.com/ajax/libs/js-sha256/0.9.0/sha256.min.js"
  crossorigin="anonymous"></script>

Make sure to modify the ZZGate Signal init code to use the sha256 function:

<script>
  p2sq.push({et:'Init',p:{
    em: sha256('john.doe@example.com'),
    fn: sha256('John'),
    ln: sha256('Doe')
    // ...
  }});
</script>

2. View Content Event

<script language="JavaScript" type="text/JavaScript">
  p2sq.push({et: 'ViewContent', p: {
    contents: [{id: '{product-id}', quantity: 1}],
    content_type: 'product',
    value: productPrice,                  // Price, e.g. 9.90
    currency: '{currency}',               // 3 Letter Currency Code, e.g. USD
    content_name:'{product-name}',        // Optional Parameters
    content_category:'{product-category}' // Optional Parameters
  // ...
  }});
</script>

3. Custom Special Event

You can use the following code if your custom event does not need parameters:

<script language="JavaScript" type="text/JavaScript">
  p2sq.push({et: 'Custom:Special'});
</script>

You may send any optional parameters you like in the p object:

<script language="JavaScript" type="text/JavaScript">
  p2sq.push({
    et: 'Custom:Special',
    p: {
      optionalParameter: anyValue
    }
  });
</script>

4. Search Event

<script language="JavaScript" type="text/JavaScript">
  p2sq.push({et: 'Search', p: {
    search_string:'{search-string}',
    contents: [
      {id:'{product-1-id}',quantity:1},
      {id:'{product-2-id}',quantity:1}
    ],
    value: productPrice,                    // Price, e.g. 9.90
    currency: '{currency}',                 // 3 Letter Currency Code, e.g. USD
    content_category: '{product-category}'  // Optional Parameters
  // ...
  }});
</script>

5. Add To Cart Event

<script language="JavaScript" type="text/JavaScript">
  p2sq.push({
    et: 'AddToCart', p: {
    contents: [
      {id:'{product-1-id}',quantity:1},
      {id:'{product-2-id}',quantity:1}
    ],
    content_type: 'product',
    value: productPrice,    // Price, e.g. 9.90
    currency: '{currency}', // 3 Letter Code, e.g. USD
  }});
</script>

6. Initiate Checkout Event

<script language="JavaScript" type="text/JavaScript">
  p2sq.push({
    et: 'InitiateCheckout', p: {
    contents: [
      {id:'{product-1-id}',quantity: 1},
      {id:'{product-2-id}',quantity: 1}
    ],
    value: productPrice,                    // Price, e.g. 9.90
    currency: '{currency}',                 // 3 Letter Currency Code, e.g. USD
    content_category:'{product-category}',  // Optional Parameters
    num_items: '{item-count}',              // Optional Parameters
    // ...
  }});
</script>

7. Purchase Event

<script language="JavaScript" type="text/JavaScript">
  p2sq.push({
    et: 'Purchase',
    p: {
      contents: [
        {id:'{product-1-id}',quantity:1},
        {id:'{product-2-id}',quantity:1}
      ],
      content_type: 'product',
      value: productPrice,    // Price, e.g. 9.90
      currency: '{currency}'  // 3 Letter Currency Code, e.g. USD
    },
    eid:'{order-id}'          // Unique Order ID – Important
  });
</script>

8. Lead Event

<script language="JavaScript" type="text/JavaScript">
  p2sq.push({
    et: 'Lead',
    p: { // Optionally the following parameters might be sent:
      content_name: '{product}', // Name of the page, product or form
      currency: '{currency}',    // 3 Letter Currency Code, e.g. USD
      value: productPrice,       // Price, e.g. 9.90
    }
  });
</script>

9. Complete Registration Event

<script language="JavaScript" type="text/JavaScript">
  p2sq.push({
    et: 'CompleteRegistration',
    p: { // Optionally the following parameters might be sent:
      content_name: '{product}',  // Name of the registration form
      currency: '{currency}',     // Three Letter Currency Code, e.g. USD
      value: productPrice,        // Price, e.g: 9.90
      status: status,             // Boolean status: whether the registration 
                                  // is actually completed
    }
  });
</script>

10. Contact Event

<script language="JavaScript" type="text/JavaScript">
  p2sq.push({et: 'Contact'});
</script> 

Back to Event List 

Comments

Popular posts from this blog

Tiktok Events API

  About Events API TikTok’s Events API is a secure server-to-server interface that allows advertisers to share the actions customers take on their websites directly with TikTok.  When web events are shared with TikTok, they can better inform our optimization, targeting, and measurement systems by providing insights into your website visitors' journeys. Our systems process the data similarly to the TikTok Pixel.  To optimize ad delivery and build marketing audiences, we recommend setting up both TikTok's Events API and Pixel together. Please follow our best practices to learn more about a redundant Web Tracking setup. Benefits of Events API Events API helps businesses to future-proof and adapt to the changing ads ecosystem, by allowing unobstructed marketing data sharing between your business and TikTok to reach your marketing objectives. Benefits of implementing TikTok’s Events API include: • ​ Improve ad delivery and targeting by capturing missing conversions.  ◦ ​ ...