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:
- Loading Code and Page View Event
- View Content Event
- Custom Special Event
- Search Event
- Add To Cart Event
- Initiate Checkout Event
- Purchase Event
- Lead Event
- Complete Registration Event
- 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
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>
Comments
Post a Comment