Skip to content

WP Pixel installation

The embed script

Implementation on every page of the website. It is recommended that the script be placed in the <head> section. The strings PIXEL_ID should be replaced with the client's dedicated identifier.

Additionally, the script allows passing of additional parameters. While user-identifying parameters are optional, providing both em and ltid enables the activation of campaigns in environments without third-party cookies — currently in Safari and Firefox browsers, and in the future, also in Chrome.

If you decide not to pass additional parameters, remove the , ADDITIONAL_PARAMETERS entry from the embed script.

<script>
    !function(w,p,e,v,n,t,s){w['WphTrackObject'] = n;
    w[n] = window[n] || function() {(w[n].queue=w[n].queue||[]).push(arguments)},
    w[n].l = 1 * new Date(), t=p.createElement(e), s=p.getElementsByTagName(e)[0],
    t.async=1;t.src=v;s.parentNode.insertBefore(t,s)}(window,document,'script',
    'https://pixel.wp.pl/w/PIXEL_ID/tr.js', 'wph');
    wph('init', 'PIXEL_ID', ADDITIONAL_PARAMETERS);
</script>

The event codes

After implementing the embed script, proceed with the implementation of the event codes:

Additional parameters

The script allows additional parameters to be provided in the optional configuration object:

  • em - user's e-mail, normalized and hashed according to the guidelines. If you provide an e-mail address in the original form, the script will normalize and hash before sending the events.
  • ltid (long-term id) - unique, text user identifier (non-empty string). Script before sending the event will remove whitespace from the beginning and the end of the identifier.
  • ltid_name - if ltid is stored in a cookie, the script can extract this value itself and send it in the event. You should then provide the name of the cookie in this parameter. If the correct ltid parameter is provided, this parameter (ltid_name) will be ignored. Both the cookie name and value should be non-empty text (string).

Embedding examples with additional parameters

Embedding without additional parameters

<script>
    !function(w,p,e,v,n,t,s){w['WphTrackObject'] = n;
    w[n] = window[n] || function() {(w[n].queue=w[n].queue||[]).push(arguments)},
    w[n].l = 1 * new Date(), t=p.createElement(e), s=p.getElementsByTagName(e)[0],
    t.async=1;t.src=v;s.parentNode.insertBefore(t,s)}(window,document,'script',
    'https://pixel.wp.pl/w/PIXEL_ID/tr.js', 'wph');
    wph('init', 'PIXEL_ID');
</script>
Embedding with hashed e-mail address (em parameter)
<script>
    !function(w,p,e,v,n,t,s){w['WphTrackObject'] = n;
    w[n] = window[n] || function() {(w[n].queue=w[n].queue||[]).push(arguments)},
    w[n].l = 1 * new Date(), t=p.createElement(e), s=p.getElementsByTagName(e)[0],
    t.async=1;t.src=v;s.parentNode.insertBefore(t,s)}(window,document,'script',
    'https://pixel.wp.pl/w/PIXEL_ID/tr.js', 'wph');
    wph('init', 'PIXEL_ID', {em:
    'f02f61d33aac1c8d56813d668299b33d05aa99adf2056c1950f688459da1a465'});
</script>
Embedding with user id (ltid parameter)
<script>
    !function(w,p,e,v,n,t,s){w['WphTrackObject'] = n;
    w[n] = window[n] || function() {(w[n].queue=w[n].queue||[]).push(arguments)},
    w[n].l = 1 * new Date(), t=p.createElement(e), s=p.getElementsByTagName(e)[0],
    t.async=1;t.src=v;s.parentNode.insertBefore(t,s)}(window,document,'script',
    'https://pixel.wp.pl/w/PIXEL_ID/tr.js', 'wph');
    wph('init', 'PIXEL_ID', {ltid: '48b69fcca1d29075b14b8aef0'});
</script>
Embedding with multiple additional parameters (ltid_name and em)
<script>
    !function(w,p,e,v,n,t,s){w['WphTrackObject'] = n;
    w[n] = window[n] || function() {(w[n].queue=w[n].queue||[]).push(arguments)},
    w[n].l = 1 * new Date(), t=p.createElement(e), s=p.getElementsByTagName(e)[0],
    t.async=1;t.src=v;s.parentNode.insertBefore(t,s)}(window,document,'script',
    'https://pixel.wp.pl/w/PIXEL_ID/tr.js', 'wph');
    wph('init', 'PIXEL_ID', {em: 'user@test.com', ltid_name: 'ID_COOKIE_NAME'});
</script>

Normalization of e-mail addresses

E-mail address normalization aims to standardize and unify the input data, towards improving the consistency of the hashing process. Correct normalization of e-mail addresses helps maintain the uniformity and uniqueness of the input data, which translates into improved security and effectiveness of the identification process.

To normalize your e-mail address, follow these steps:

  • remove spaces from the beginning and from the end of the address;
  • convert all ASCII characters to lowercase;
  • in e-mail addresses from the gmail.com domain remove the following characters from the username part of the e-mail address:

    dot . e.g. john.smith@gmail.com should be changed to johnsmith@gmail.com;

  • remove the + sign and all following characters from the username part of the e-mail address:

    e.g. johnsmith+newsletter@wp.pl should be replaced by johnsmith@wp.pl.

Hash encoding of e-mail addresses

The e-mail address normalization method is intended to enable IT systems to securely store and analyze user identification information. Hashing, which is the process of transforming input data (including e-mail addresses) into a unique string of characters of a fixed length, allows for effective secrecy of the original data while maintaining its uniqueness.

Identifying hashed e-mail addresses is a key part of information security practices. Introducing hashed versions of e-mail addresses allows systems to store identifying information in a way that minimizes the risk of privacy breaches.

The normalized e-mail address should be hashed with the SHA-256 hashing algorithm. The hashed e-mail address should be a hexadecimal string of characters.