Volgen

Facebook advertenties - Pixel documentatie

The KMH pixel container snippet is a small piece of JavaScript that you paste into your pages on your website. It enables KijkMijnHuis to load the KMH pixel into the page.

The KMH pixel container needs to be implemented on all pages of your website (1.) and with an added snippet on your listing pages (2.).

  1. Code snippet
  2. Code snippet for listing page

1. Correct implementation for basic code snippet

To implement the KMH pixel container, copy the code snippet (Google Tag Manager) provided from below. Paste this snippet into your website template page so that it appears immediately after the opening <body> tag.

<!-- KMH pixel --> 
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= '//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','kmhPixel','GTM-PX4GN2');</script> 
<!-- End KMH pixel -->

2. Correct implementation for code snippet on listing page

To ensure maximum flexibility, portability, and ease of implementation, the KMH pixel functions best when deployed alongside a data layer. A data layer is an object that contains all of the information that you can to pass to the KMH pixel. Information such as objectIdentifier can be passed to the KMH pixel via this data layer. Always place the code above the KMH pixel snippet!

<script>
  kmhPixel = [{
      'objectIdentifier': 'XXXXXX',
      'objectZipcode': 'XXXXXX'
  }];
</script>

<!-- KMH pixel --> 
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= '//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','kmhPixel','GTM-PX4GN2');</script> 
<!-- End KMH pixel -->

Note: The variable "XXXXXX" is just an example. You need to adjust this variable to the object identifier and zipcode you use on your website. If you put the KMH pixel container snippet between the <body> tag and the dataLayer array, the verification of the container snippet fails and KMH pixel cannot read the variables defined in the array.

Was dit artikel nuttig?
Aantal gebruikers dat dit nuttig vond: 0 van 0
Hebt u meer vragen? Een aanvraag indienen

Opmerkingen