Giter Site home page Giter Site logo

tracksmart-prestashop's Introduction

TrackSmart

tracksmart-prestashop Build Status

Module to enhanced tracking for Google Analytics 4 (via Google Tag Manager).

Advantages of module

  • Very light (no unnecessary libraries)
  • Efficient (no database queries)
  • Scrupulous (sends necessary information in the correct formats)
  • Flexible (e.g.: implementations for Facebook Pixel, simple API in JavaScript, and more)
  • Open source

Features

  • Categories page view
  • Products page view
  • Products added to cart
  • Products removed from cart
  • Checkout
  • Purchase

Google Tag Manager settings provided in module, include example implementations for Google Analytics 4 and Facebook Pixel.

Requirements

  • PrestaShop 1.7+
  • PHP 7+

How to set up?

PrestaShop

  • Download files from releases
  • Install in PrestaShop
  • Provide Container ID from GTM, mark as ready and save :)

General settings

Google Analytics 4

  • Create new property (select target country and currency)

New property

  • Set up new data stream: Web

Setup new data stream

  • Provide details

Setup new data stream

  • Save Measurement ID

Measurement ID

Facebook Pixel

Create and get ID of Facebook Pixel: here

Google Tag Manager

  • Set up settings from container.json file (help is available here).
  • Replace values in variables:
    • (Settings) Google Analytics to Measurement ID
    • (Settings) Facebook Pixel to ID of Facebook Pixel
  • Push tags. Done :)

API

JSON

  • Request URL: http://yoursite.com/module/tracksmart/ajax
  • Request body:
  • Response:
{
  "item_name": "Item name",
  "item_id": 12345,
  "price": 12.34,
  "item_brand": "Brand",
  "item_category": "Category",
  "item_variant": "Variant",
  "quantity": 1
}
  • Exceptions:
    • 400: Bad Request

JavaScript

In header, module create instance of TrackSmart as variable trackSmart.

let trackSmart = new TrackSmart('CONTAINER_ID', 'USER_ID'); // 'USER_ID' is optional
trackSmart.build(); // Initialize connection
trackSmart.process('event_name', {
    ecommerce: 'event_body'
}); // Send request to Google Tag Manager
trackSmart.destroy(); // Destroy session

License

GNU General Public License v3.0

tracksmart-prestashop's People

Contributors

kacperduras avatar xelance-com avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

tracksmart-prestashop's Issues

GTM: problem with trigger

Witaj dobry czlowieku!,
dwa problemy:

  1. Błąd instalacji modułu - patrz config.xml vs nazwa katalogu pobranego z repo to tracksmart-prestashop a w configu jest tracksmart (ja sobie zmieniłem nazwę, ale może być ktoś mniej kumaty technicznie)
  2. Dodaje kod od gtm, ale nie odbiera prawidłowo danych po stronie kontenera gtm. Dane do datalayera wysyła, ale nie odpala tagów i nie wysyła danych. Chyba szablon kontenera wymaga poprawki.

Hi,
got some problems with module and it's addons

  1. Problem with installation - look at config.xml - name of directory downloaded by git is tracksmart vs tracksmart-prestashop (i managed to fix this by renaming folder but for others it may be a problem)
    creates gtm containter but does not send data
  2. I have a problem with gtm container. It looks like plugin work - debuger says there is some data in datalayer but it does not receive on the gtm side. because i can't see any fired tags.

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.