Giter Site home page Giter Site logo

williankeller / magento2-facebook-pixel Goto Github PK

View Code? Open in Web Editor NEW
36.0 6.0 15.0 71 KB

This free Facebook Pixel extension allows you to track your visitors' actions.

License: Open Software License 3.0

PHP 77.76% JavaScript 13.79% HTML 8.45%
magento2-module magento-extension magento2-facebook magento2-pixel facebook-pixel pixel-track magento2-facebook-pixel

magento2-facebook-pixel's Introduction

Facebook Pixel for Magento 2

This free Facebook Pixel extension allows you to track your visitors' actions by sending events to your Facebook Ads Manager and the Facebook Analytics dashboard where they can be used to analyze the effectiveness of your conversion funnel and to calculate your return on ad investment.

This extension is also compatible with Magento Cookies Policy.

Build Status Packagist Downloads

Compatibility

This is the tested versions:

>= 2.3.1 EE/CE

Installation

Install via composer (recommended)

Run the following command in Magento 2 root folder:

composer require magestat/module-facebook-pixel

Using GIT clone

Run the following command in Magento 2 root folder:

git clone [email protected]:magestat/magento2-facebook-pixel.git app/code/Magestat/FacebookPixel

Activation

Run the following command in Magento 2 root folder:

php bin/magento module:enable Magestat_FacebookPixel
php bin/magento setup:upgrade

Clear the caches:

php bin/magento cache:clean

Configuration

  1. STORES > Configuration > MAGESTAT > Facebook Pixel:
  2. Enable Module tab, select Enabled option to enable the module (toggling per store).
  3. Settings tab, Select option if you want to Include Product Taxes.
  4. Pixel ID tab, Fill the Facebook Pixel Track Code ID.
  5. Track Options tab, Select which events you want to track.

Currently tracking:

  • Page view:
    • Content view
    • All and every page load
  • Product page:
    • Content view
    • Add to cart event
  • Checkout page:
    • Content view
    • Initiate checkout event
  • Success page
    • Content view
    • Purchase event

Missing an Event Track?

Let us know if your looking for a custom track or one of our events are not triggered properly.

Contribution

Want to contribute to this extension? The quickest way is to open a pull request on GitHub. If we like your suggestion we will add this request for free at the next releases.

Support

If you encounter any problems or bugs, please open an issue on GitHub.

magento2-facebook-pixel's People

Contributors

breakerh avatar erfanimani avatar liamkarlmitchell avatar williankeller avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

magento2-facebook-pixel's Issues

Store config disappears when selecting website scope

To Reproduce
Steps to reproduce the behavior:

  • As an admin, navigate to Magestat Facebook pixel
  • Select website scope

Expected behavior

  • Allow config to be set on a website scope

Actual behavior

  • Magestat config disappears

Uncaught Error: Call to undefined method PriceCurrency::roundPrice when viewing Product Page.

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Install module, and enable, but not marked as enabled in Magento Admin Settings.
View product page.

Expected behavior
Product page should load.

{
    "*": {
        "Magestat_FacebookPixel/js/actions/product": {
            "currency": "NZD",
            "contents": <br />
<b>Fatal error</b>:  Uncaught Error: Call to undefined method Magento\Directory\Model\PriceCurrency::roundPrice() in /var/www/html/app/code/Magestat/FacebookPixel/Block/AbstractPixel.php:145
Stack trace:
#0 /var/www/html/app/code/Magestat/FacebookPixel/Block/Product.php(74): Magestat\FacebookPixel\Block\AbstractPixel-&gt;formatPrice(14.99)
#1 /var/www/html/app/code/Magestat/FacebookPixel/view/frontend/templates/actions/product.phtml(9): Magestat\FacebookPixel\Block\Product-&gt;getCurrentProduct()
#2 /var/www/html/vendor/magento/framework/View/TemplateEngine/Php.php(59): include('/var/www/html/a...')
#3 /var/www/html/vendor/magento/framework/View/Element/Template.php(271): Magento\Framework\View\TemplateEngine\Php-&gt;render(Object(Magestat\FacebookPixel\Block\Product), '/var/www/html/a...', Array)
#4 /var/www/html/vendor/magento/framework/View/Element/Template.php(301): Magento\Framework\View\Element\Template-&gt;fetchView('/var/www/html/a...')
#5 /var/www/html/app/code/Magestat/FacebookPixel/Block/AbstractPixel.php(81): Magento\Framework\Vi in <b>/var/www/html/app/code/Magestat/FacebookPixel/Block/AbstractPixel.php</b> on line <b>145</b><br />

obsolete function

hello,

i have an error when i enable this module,
because the function roundPrice in magestat/module-facebook-pixel/Block/AbstractPixel.php line 153 is depreciate
i replace roundPrice by convertAndRound , and it's work verry good

Ability to choose which cookie to use for consent

Is your feature request related to a problem? Please describe.
Due to GDPR magento cookie consent is no use as visitors need to be able to choose between categories so we use alternative cookie consent methods and disabled magento built in cookie function. This means that the pixel will always trigger and use cookies even if users choose no to consent.

Describe the solution you'd like
Option to either use Magento built in consent, or alternative method and if alternative method is chosen to be able to set which cookie to look for and the value of it.

e.g. Cookie to look for: 'cookieyes-analytics'
Value for consent: 'yes'

Describe alternatives you've considered
using GTM for creating the pixel data or modifying the code to include additional script to prevent script running.

Additional context

Composer version still use 1.0.2 which is incompatible with PHP 7.3.x

Describe the bug
Running bin/composer require magestat/module-facebook-pixel on PHP 7.3 and above will cause:

[InvalidArgumentException]
Could not find package magestat/module-facebook-pixel in any version matching your PHP version (7.3.13)

as it is downloading from tag 1.0.2 which limit PHP to PHP 7.2.x

Store view option is not available

Hello guys,

when we try to setup the extension for a specific store view in the Store > Configuration > Magestat > Pixel this one disappear!

Can you help us to solve this issue?

thanks

Conversion value not tracked for Paypal Express checkout

Hi,

Thanks for the great free extension. Everything looks to be working great on our Magento 2.3.3 install. We use native Magento checkout. We are noticing that conversion value is not tracked when customers uses PayPal express checkout.

If the customer clicks Paypal Express checkout button from the cart page and bypasses the Magento checkout, they will visit the Paypal Review page to select the postage method then hit the success page after payment.

We are noticing conversion is tracked in Facebook but not the conversion value, comes in as £0.00

It would be great if there was a solution.

Thanks again

Website Purchases Pixel Not Showing Sales?

We have added the pixel code below that is for tracking website purchases for Facebook Ads

Website: https://www.tigress.com.au

Its confirmed that the dynamic pricing is working as expected, however there is no actual sales value being shown in the Facebook ads dashboard (Restricted access so that cannot be shown currently).

This is the thank-you page pixel information:

https://drive.google.com/file/d/1I9fwP_knrRd-BMPuZXugrcHaeI7k2Vk1/view

This is the thank-you page code:

https://docs.google.com/document/d/1vL5bFHR-raUX6h9Y9c9psYtEPV4DPrgGASedKZ9BmYU/edit


Website Pixel code for tracking website purchases:

<script type="text/x-magento-init"> { "*": { "Magestat_FacebookPixel/js/pixel-code": { "isCookieEnabled": 0, "currentWebsite": 1, "pixelCode": "880232132408668", "storeCurrency": "AUD", "cookieName": "user_allowed_save_cookie" } } } </script> <script type="text/x-magento-init"> { "*": { "Magestat_FacebookPixel/js/actions/success": { "currency": "AUD", "contents": [{"id":"PQ245W-NW","name":"\"Monaco\" Hampton Style Pedestal Recycled Elm Timber Dining Table Natural with White Base 245cmW x 105cmD x 77cmH","item_price":2199,"quantity":1}], "contentIds": ["PQ245W-NW"], "total": "2398" } } } </script>

Magento version. 2.3.3
Edition: Magento Commerce


Configuration settings

https://drive.google.com/file/d/1UUZfVnDpObu1FlSxRUXH38-GCdHS-nXF/view


Date of install:

It's 23/06/2020
Version: 1.0.5


  • OS: macOS Catalina 10.15.6
  • Browser Brave
  • Version 1.10.95 Chromium: 83.0.4103.106 (Official Build) (64-bit)

HTML validation error

An img tag appears in a noscript tag within <head>. Image tags can't appear within the document head.

Moreover, the entirety of pixel-code.phtml could be moved to the body, or before-body-end container, as I believe the RequireJS javascript only kicks in after the whole page is loaded anyway. For scripts initialized with "text/x-magento-init" it shouldn't make a difference whether it's located in the head, or body.

Are you happy for me to create a PR @williankeller ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.