fbpx

NextTrain.io

<!-- 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');
  fbq('init', 'YOUR_PIXEL_ID'); // Insert your pixel ID here.
  fbq('track', 'PageView');
</script>
<noscript><img height="1" width="1" style="display:none"
  src="https://www.facebook.com/tr?id=YOUR_PIXEL_ID&ev=PageView&noscript=1"
/></noscript>
<!-- End Facebook Pixel Code -->

<!-- Purchase Event Code -->
<script>
  fbq('track', 'Purchase', {value: '20', currency: 'AED'}); // Replace with the actual value and currency of the purchase
</script>
<!-- Twitter conversion tracking event code -->
<script type="text/javascript">
  // Insert Twitter Event ID
  twq('event', 'tw-ol1e1-ol7ok', {
    value: null, // use this to pass the value of the conversion (e.g. 5.00)
    currency: null, // use this to pass the currency of the conversion with an ISO 4217 code (e.g. ‘USD’)
    contents: [ // use this to pass an array of products or content
        // add all items to the array
        // use this for the first item
        {
          content_type: null,
          content_id: null,
          content_name: null,
          content_price: null,
          num_items: null,
          content_group_id: null
        },
        // use this for the second item
        {
          content_type: null,
          content_id: null,
          content_name: null,
          content_price: null,
          num_items: null,
          content_group_id: null
        }], 
    conversion_id: null, // use this to pass a unique ID for the conversion event for deduplication (e.g. order id '1a2b3c')
    email_address: null, // use this to pass a user’s email address
    phone_number: null // phone number in E164 standard
  });
</script>
<!-- End Twitter conversion tracking event code -->
ttq.identify({
	"email": "<hashed_email_address>", // string. The email of the customer if available. It must be hashed with SHA-256 on the client side.
	"phone_number": "<hashed_phone_number>", // string. The phone number of the customer if available. It must be hashed with SHA-256 on the client side.
	"external_id": "<hashed_extenal_id>" // string. Any unique identifier, such as loyalty membership IDs, user IDs, and external cookie IDs.It must be hashed with SHA-256 on the client side.
});

ttq.track('ViewContent', {
	"contents": [
		{
			"content_id": "<content_identifier>", // string. ID of the product. Example: "1077218".
			"content_type": "<content_type>", // string. Either product or product_group.
			"content_name": "<content_name>" // string. The name of the page or product. Example: "shirt".
		}
	]
});

ttq.track('Subscribe', {
	"contents": [
		{
			"content_id": "<content_identifier>", // string. ID of the product. Example: "1077218".
			"content_type": "<content_type>", // string. Either product or product_group.
			"content_name": "<content_name>" // string. The name of the page or product. Example: "shirt".
		}
	]
});

ttq.track('InitiateCheckout', {
	"contents": [
		{
			"content_id": "<content_identifier>", // string. ID of the product. Example: "1077218".
			"content_type": "<content_type>", // string. Either product or product_group.
			"content_name": "<content_name>" // string. The name of the page or product. Example: "shirt".
		}
	]
});

ttq.track('CompletePayment', {
	"contents": [
		{
			"content_id": "<content_identifier>", // string. ID of the product. Example: "1077218".
			"content_type": "<content_type>", // string. Either product or product_group.
			"content_name": "<content_name>" // string. The name of the page or product. Example: "shirt".
		}
	],
	"value": "<content_value>", // number. Value of the order or items sold. Example: 100.
	"currency": "<content_currency>" // string. The 4217 currency code. Example: "USD".
});

ttq.track('Passport Purchase', {
	"contents": [
		{
			"content_id": "<content_identifier>", // string. ID of the product. Example: "1077218".
			"content_type": "<content_type>", // string. Either product or product_group.
			"content_name": "<content_name>" // string. The name of the page or product. Example: "shirt".
		}
	],
	"value": "<content_value>", // number. Value of the order or items sold. Example: 100.
	"currency": "<content_currency>" // string. The 4217 currency code. Example: "USD".
});

Your subscription has been set up successfully.