
WP Pixel Integration with sklepyWWW.pl
Warning
The plugin currently does not have active support.
In case of errors, we recommend integration via Google Tag Manager or manually embedding the codes on your site.
Step 1: Initialize WP Pixel in the <head>
Path: Tools > Webmaster Tools > Additional javascript code in HEAD section

- Open this tool in the panel.
- Paste the WP Pixel initialization code here.
Important!
Remember to replace the PIXEL_ID with your own Pixel ID!
The website administrator is responsible for properly embedding the WP Pixel tracking script, i.e., after the user has given consent.
The script should be embedded in its entirety, and calling the wph('go') function within it signifies the user's consent to tracking.
Withdrawing user consent should result in calling the wph('stop') function.
<!-- WP PIXEL CODE: INIT -->
<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(), w[n].v = '2.0', 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');
wph('go');
</script>
<!-- END WP PIXEL CODE: INIT -->
Step 2: ViewProduct on the product page
Path: Tools > Webmaster Tools > Additional code on product page

- Open this tool in the panel.
- Paste the tracking script for “ViewProduct” here (adjusted to your variables).
<!-- WP PIXEL CODE: VIEWPRODUCT -->
<script>
function whenAvailable(name, callback) {
var interval = 10; // ms
window.setTimeout(function() {
if (window[name]) {
callback(window[name]);
} else {
whenAvailable(name, callback);
}
}, interval);
}
function test(object, value) {
return Object.keys(object).find(key => object[key] === value);
}
function flattenObj(obj){
let flat = {}
for(let i in obj){
if(typeof obj[i] == 'object'){
let flatObj = flattenObj(obj[i])
for(let x in flatObj){
flat[i + "." + x] = flatObj[x]
}
} else {
flat[i] = obj[i]
}
}
return flat
}
whenAvailable("get_products_data", function(t) {
flat_categories = flattenObj(categories)
wph('track', 'ViewContent', {
'content_name': 'ViewProduct',
contents: [{
id: '#PRODUCT_ID#',
name: '#PRODUCT_NAME#',
price: Number(Number(get_products_data(#PRODUCT_ID#).price_special).toFixed(2)),
category: test(flat_categories, Number(get_products_data('#PRODUCT_ID#').category_id)) == undefined? undefined : flat_categories[test(flat_categories, Number(get_products_data('#PRODUCT_ID#').category_id)).split('.').slice(0,test(flat_categories, Number(get_products_data('#PRODUCT_ID#').category_id)).split('.').length-1).join('.')+".name"]
}]
})
})
</script>
<!-- END WP PIXEL CODE: VIEWPRODUCT -->
Step 3: View, ProductList and AddToCart in <body>
Path: Tools > Webmaster Tools > Additional javascript code in BODY section
- Open this tool in the panel.
- Paste the scripts here:
- tracking views (
ViewContent) - tracking product list (
ProductList) - tracking add to cart (
AddToCart)

<!-- WP PIXEL CODE: VIEW, PRODUCTLIST AND ADDTOCART -->
<script>
wph('track', 'ViewContent', { 'content_name': 'View' })
</script>
<script>
add_to_basket = function(products_id, quantity, id)
{
if(quantity == 0)
{
if($("#add_product_overlay").length > 0)
{
$("#add_product_overlay").remove();
// resume page scrolling
wznowPrzewijanie();
}
return;
}
product = get_products_data(products_id);
function test(object, value) {
return Object.keys(object).find(key => object[key] === value);
}
function flattenObj(obj){
let flat = {}
for(let i in obj){
if(typeof obj[i] == 'object'){
let flatObj = flattenObj(obj[i])
for(let x in flatObj){
flat[i + "." + x] = flatObj[x]
}
} else {
flat[i] = obj[i]
}
}
return flat
}
flat_categories = flattenObj(categories)
if (id || product_page || !product.with_options) {
quantity = (quantity == undefined ? 1 : quantity);
id = (id != undefined ? id : "");
wph('track', 'AddToCart', {
contents: [{
id: product.product_id,
name: product.name,
price: Number(Number(product.price_special).toFixed(2)),
category: test(flat_categories, Number(product.category_id)) == undefined? undefined : flat_categories[test(flat_categories, Number(product.category_id)).split('.').slice(0,test(flat_categories, Number(product.category_id)).split('.').length-1).join('.')+".name"],
quantity: quantity
}]
});
$.ajax({
type: "POST",
url: "rpc.php?action=add_to_basket",
dataType: "json",
data: "products_id="+products_id+"&quantity="+quantity+id,
success: function(response){
let error = true;
let data = null;
if (response != false) {
try {
data = JSON.parse(response);
error = false;
} catch (error) {}
}
if (!error) {
if(basket_redirect)
redirect_to_basket();
else {
$("#add_product_overlay").remove();
wznowPrzewijanie();
AddBasketData.construct(data, quantity, id);
add_to_basket_info();
refresh_cart();
}
} else
alert(ERROR_ADDING_TO_CART);
},
error: function() {
alert(ERROR_ADDING_TO_CART);
}
});
} else
draw_add_product_form(product, quantity);
}
</script>
<script>
contents = []
keys = document.querySelector("div.listing").querySelectorAll("a[data-idproduktu]")
function flattenObj(obj){
let flat = {}
for(let i in obj){
if(typeof obj[i] == 'object'){
let flatObj = flattenObj(obj[i])
for(let x in flatObj){
flat[i + "." + x] = flatObj[x]
}
} else {
flat[i] = obj[i]
}
}
return flat
}
function test(object, value) {
return Object.keys(object).find(key => object[key] === value);
}
flat_categories = flattenObj(categories)
for (i = 0; i < keys.length; i++){
id = keys[i].getAttribute("data-idproduktu")
contents.push({id: id,
name: get_products_data(id).name,
price: Number(Number(get_products_data(id).price_special).toFixed(2)),
category: test(flat_categories, Number(get_products_data(id).category_id)) == undefined? undefined : flat_categories[test(flat_categories, Number(get_products_data(id).category_id)).split('.').slice(0,test(flat_categories, Number(get_products_data(id).category_id)).split('.').length-1).join('.')+".name"]
})
}
if(contents.length > 0 & window.location.pathname.includes('-c-')){
wph('track', 'ViewContent', {
'content_name': 'ProductList',
contents: contents
})
}
</script>
<!-- END WP PIXEL CODE: VIEW, PRODUCTLIST AND ADDTOCART -->
Step 4: Purchase event (order completion)
Path: Configuration > Sales > Order handling:

Click Edit on the module Custom JavaScript:

- Open editing of this module.
<!-- WP PIXEL CODE: PURCHASE-->
<script>
ids = "#PRODUCTS_IDS_x#"
ids = ids.split('x')
contents = []
function whenAvailable(name, callback) {
var interval = 10; // ms
window.setTimeout(function() {
if (window[name]) {
callback(window[name]);
} else {
whenAvailable(name, callback);
}
}, interval);
}
function flattenObj(obj){
let flat = {}
for(let i in obj){
if(typeof obj[i] == 'object'){
let flatObj = flattenObj(obj[i])
for(let x in flatObj){
flat[i + "." + x] = flatObj[x]
}
} else {
flat[i] = obj[i]
}
}
return flat
}
function test(object, value) {
return Object.keys(object).find(key => object[key] === value);
}
whenAvailable("categories", function(t) {
flat_categories = flattenObj(categories)
for(var i =0; i < ids.length; i++){
id = ids[i];
item = {id: id,
name: get_products_data(id).name,
price: Number(Number(get_products_data(id).price_special).toFixed(2)),
category: test(flat_categories, Number(get_products_data(id).category_id)) == undefined? undefined :
flat_categories[test(flat_categories, Number(get_products_data(id).category_id)).split('.').slice(0,test(flat_categories,
Number(get_products_data(id).category_id)).split('.').length-1).join('.')+".name"]
}
contents.push(item)
}
wph('track', 'Purchase', {
transaction_id: "#ORDER_ID#",
value_gross: Number((#SUBTOTAL#).toFixed(2)),
shipping_cost: Number((#TOTAL# - #SUBTOTAL#).toFixed(2)),
contents: contents
});
})
</script>
<!-- END WP PIXEL CODE: PURCHASE -->
Done!
WP Pixel integration has been successfully completed 🎉
If you encounter technical difficulties, you can use integration via GTM or ask your developer for support.
Warning
The Plugin is provided “AS IS”, WITHOUT ANY WARRANTIES, either express or implied, including but not limited to implied warranties of merchantability, fitness for a particular purpose, proper functioning, compatibility with external platforms (such as Shopify, WooCommerce, PrestaShop, or other e-commerce systems), or compatibility with other plugins. Wirtualna Polska Media S.A. does not warrant that the Plugin will be error-free, operate without interruption, or meet the User’s expectations.
TO THE MAXIMUM EXTENT PERMITTED BY LAW, WIRTUALNA POLSKA MEDIA S.A. DISCLAIMS ALL LIABILITY for any damages arising from the use of or inability to use the Plugin, including indirect, consequential, or incidental damages, loss of profits, data, or business interruption, regardless of the legal basis of the claim.
Wirtualna Polska Media S.A. may, but is not obligated to, update the Plugin. The company shall not be liable for any issues resulting from updates, changes to APIs or infrastructures of external platforms (e.g., Shopify, WooCommerce, PrestaShop, or other e-commerce systems), or interactions with other software. The User is responsible for testing the Plugin before production use and bears sole responsibility for maintaining compatibility within their environment. By using the Plugin, the User accepts these terms and assumes all risks associated with its use.
The above provisions do not exclude liability for damages caused intentionally by Wirtualna Polska Media S.A., nor in any cases where such exclusion would be contrary to mandatory provisions of law.