v1.1.x Facebook Pixel for Shopware (MndFacebookPixel) -EN

URL to Shopware Storehttps://store.shopware.com/en/mnd5298432986837/facebook-pixel-for-shopware.html
Shopware compatibility5.0.0 +
DateChange
15.06.2018

Documentation changes for version 1.1.3


07.12.2020

Documentation changes for version 1.1.8

  • from version 1.1.8 we changed the handling of the control cookie



Description

The plugin "Facebook Pixel for Shopware" integrates Facebook's tracking feature into Shopware. Predefined events are triggered in the Shopware storefront and submitted to Facebook.

From version 1.1.1 the plugin provides default settings for privacy opt-in/opt-out of visitors. There are javascript functions available with which you can trigger a manuel opt-in or opt-out (see chapter "opt-in or opt-out" in this document).

From version 1.1.3 this plugin integrations into the privacy-settings of our plugin Cookie Notice with opt-in/opt-out privacy settings (from version 1.2.0) so a visitor can control its opt-in/opt-out status via these privacy settings.You can find more details in the documentation here: v1.3.0 Cookie Notice (MndCookieNotice) - EN


Statement "facebook for business"

"The Facebook pixel is a piece of code that you can place on your website to report conversions, build audiences and get rich insights about how people are using your website."

More information on Facebook: https://www.facebook.com/business/help/651294705016616
Please make sure to check your privacy statement for legal compliancy and if the usage of this plugin i.e. Facebook Pixel is legal in your country.


Features of the plugin

The plugin adds the Facebook Pixel tracking code to your shop. The plugin can be configured, activated and deactivated for each Subshop.

The following events will be tracked:

DescriptionFB-Pixel-EventRelevant Shopware Events / ActionsParameter
Search and Ajax-SearchSearch

controller: search

method: defaultSearch

search_string: Entered search text
content_category: 'Product Search'
Content viewViewContent

controller: detail

method: index

content_name: Article name
content_category: Name of Category (no Category path)
content_ids: article-ID or ordernumber (see plugin configuration)
content_type: 'product'
value: Article price
currency: ISO currency code of current store
Add to cartAddToCartClick on Buy-Button
content_name: Article name
content_ids: article-ID or ordernumber (see plugin configuration)
content_type: 'product'
value: Article price
currency: ISO currency code of current store
Customer signed upCompleteRegistration
when completed registration

controller: account

value: Basket value excl. shipping
currency: ISO currency code of current store
content_name: 'Registration'
status: 'complete'
Customer initiates checkout
InitiateCheckout

controller: checkout

method: confirm

value: Basket value
currency: ISO currency code of current store
content_name: 'Checkout',
content_ids: article-ID or ordernumber (see plugin configuration)
content_type: 'product' oder 'product_group'
num_items: Number of items in basket
PurchasePurchase

controller: checkout

method: finish

Only one item was ordered:
content_name: Article name
content_category: Category name of the article
content_ids: article-ID or ordernumber (see plugin configuration)
content_type: 'product',
value: Order value
currency: ISO currency code of current store 
Multiple items ordered:
content_ids: Article-ID or Order-ID (see plugin configuration)
content_type: 'product',
value: Basket value
currency: ISO currency code of current store
Customer adds article to wishlistAddToWishlist

controller: newsletter

method: finish

value: Basket value,
currency: ISO currency code of current store,
content_name: Article name,
content_ids: Article-ID or Order-ID (see plugin configuration),
content_type: 'product'

Customer registers for newsletter or sends a contact form (contact form or inquiry form by default)Lead

controller: newsletter

method: index

controller: forms

method: index

Newsletter registration:

content_name: 'Newsletter registration'

Contact form submit:

content_name: 'Contact form submitted'
For more information about the specific events please see: https://www.facebook.com/business/help/402791146561655


You can customize all event values via the shopware templateing system


Installation and Usage

Install the plugin using the Shopware Plugin Manager.

After the installation you should clear the Shopware Caches (Frontend and HTTP-Proxy).

Further information about the installation process in Shopware:

Plugin-Installation: http://en.community.shopware.com/_detail_1638.html?_ga=1.157404536.358724997.1486735614
Plugin-Manager: http://en.community.shopware.com/_detail_1858.html?_ga=1.157404536.358724997.1486735614


Plugin-Configuration


Make sure the currency codes in the currency settings of your shopware installation comply to ISO 4217.


You can configure if the plugin should be activated for each Subshop.

Enter your Facebook Pixel-ID.

Select which identifier should be used for the articles.

  • internal article-ID of Shopware
  • the official ordernumber

You can change the form IDs (contact form and inquiry form by default) to activate/deactivate the lead tracking for specific forms.
If you want to provide opt-in or opt-out you need to specify the desired functionality. Change the respective configuration options if you want to submit values with tax included and/or shipping costs.


The identifer must match the uploaded articles in your facebook catalogue.


Facebook Statistics

Opt-in or opt-out

Opt-in

Pixel Tracking is disabled and the user needs to opt-in by clicking the opt-in link (see below).

Opt-out

Pixel Tracking is active and the user has the option to disable the tracking by clicking the opt-out link.


In both cases a cookie consisting of the shops hostname and the suffix "-mnd-fb-pixel" is set. The value is either "optin" or "optout". The cookie lifetime is set to 100 years.


Please use the following links to integrate the respective functionality:

Opt-in: 

<a href="javascript:mndCookie.mndSetPixelOptIn();" onclick="alert('Facebook Pixel tracking enabled.');">Enable Facebook Pixel tracking</a>

Opt-out:

<a href="javascript:mndCookie.mndSetPixelOptOut();" onclick="alert('Facebook Pixel tracking disabled.');">Disable Facebook Pixel tracking</a>

From version 1.1.3 this plugin integrations into the privacy-settings of our plugin Cookie Notice with opt-in/opt-out privacy settings (from version 1.2.0) so a visitor can control its opt-in/opt-out status via these privacy settings.
You can find more details in the documentation here: v1.3.0 Cookie Notice (MndCookieNotice) - EN

Advanced Matching

Advanced matching improves the identification of your customers by submitting additional data like name, e-mail or phone numbers to Facebook.
Please see the Facebook documentaction for more information about the functionality and submitted data.

Item export

To export your items to the Facebook product catalogue you'll need an export template. You can use the following template to get you started.

Header

{strip}
id{#S#}
title{#S#}
description{#S#}
image_link{#S#}
link{#S#}
gtin{#S#}
mpn{#S#}
brand{#S#}
condition{#S#}
product_type{#S#}
price{#S#}
shipping{#S#}
google_product_category{#S#}
availability
{/strip}{#L#}

Body

{strip}
{$sArticle.ordernumber|escape}{#S#}
{$sArticle.name|strip_tags|strip|trim|truncate:150:"...":true|escape|regex_replace:"#[^\w\.%&\-+ \|]#iu":""|replace:";":","}{#S#}
{$sArticle.description_long|strip_tags|strip|trim|truncate:150:"...":true|escape|regex_replace:"#[^\w\.%&\-+ \|]#iu":""|replace:";":","}{#S#}
{$sArticle.image|image}{#S#}
{$sArticle.articleID|link:$sArticle.name|escape}{#S#}{$sArticle.ean|escape}{#S#}
{$sArticle.suppliernumber|escape}{#S#}
{$sArticle.supplier|replace:"|":""}{#S#}
new{#S#}
{$sArticle.articleID|category:">"|escape|replace:"|":""}{#S#}
{$sArticle.price|escape:"number"}{#S#}
DE::DHL:{$sArticle|@shippingcost:"prepayment":"de"}{#S#}
{$sArticle.articleID|category|escape}{#S#}
"{if $sArticle.instock>0}in stock
{elseif $sArticle.releasedate && $sArticle.releasedate|strtotime > $smarty.now}preorder
{elseif $sArticle.shippingtime}in stock
{else}out of stock{/if}"
{/strip}{#L#}


Uninstall

The Plugin is also uninstalled using the Plugin manager.