CoreShop eCommerce Tracking

CoreShop currently implements Tracking for Analytics and Google Tag Manager. Tracking is automatically available (but not enabled), as soon as you enable Tag Manager or Analytics in Pimcore.

Per default configuration, all the ecommerce trackers are disabled. You need to enable them manually.

Available Trackers

  • google-analytics-enhanced-ecommerce
  • google-analytics-universal-ecommerce
  • google-gtag-enhanced-ecommerce
  • google-gtm-classic-ecommerce
  • google-gtm-enhanced-ecommerce
  • matomo (piwik)

Enabling Trackers

core_shop_tracking:
    trackers:
        google-analytics-enhanced-ecommerce:
            enabled: false
        google-analytics-universal-ecommerce:
            enabled: false
        google-gtag-enhanced-ecommerce:
            enabled: false
        google-gtm-classic-ecommerce:
            enabled: false
        google-gtm-enhanced-ecommerce:
            enabled: false
        matomo:
            enabled: true

External

Actions

Product Impression
$this->get('coreshop.tracking.manager')->trackProductImpression($product);
Product View
$this->get('coreshop.tracking.manager')->trackProduct($product);
Product Action Add from Cart
$this->get('coreshop.tracking.manager')->trackCartAdd($cart, $product);
Product Action Remove from Cart
$this->get('coreshop.tracking.manager')->trackCartRemove($cart, $product);
Checkout Step
$this->get('coreshop.tracking.manager')->trackCheckoutStep($cart, $stepIdentifier, $isFirstStep, $checkoutOption)
Checkout Complete
$this->get('coreshop.tracking.manager')->trackCheckoutComplete($order)

Add a custom Tracker

To add a custom tracker you need to implement the interface CoreShop\Component\Tracking\Tracker\TrackerInterface

app.tracking.tracker.my_tracker:
    class: AppBundle\Tracker\CustomTracker
    parent: coreshop.tracking.tracker.ecommerce_tracker
    tags:
        - { name: coreshop.tracking.tracker, type: app-custom-tracker }

Google Tag Manager

If you have enabled the gtm in backend, CoreShop sends some data to a dataLayer object which submits the object to gtm.

GTM Classic eCommerce

If you enable the classic mode only the order gets submitted if user has successfully reached the "thank-you" page.

GTM Enhanced eCommerce

There are six Impressions/Events for Google Tag Manager Enhanced eCommerce:

Product Impression

Tag Config Example:

Tag type : Universal Analytics
Track type : Pageview
Enable Enhanced Ecommerce Features: true
Use Data Layer: true
Trigger: event equals gtm.dom

Product Detail View

Tag Config Example:

Tag type : Universal Analytics
Track type : Pageview
Enable Enhanced Ecommerce Features: true
Use Data Layer: true
Trigger: event equals gtm.dom

Checkout Step:

Event-Name: csCheckout

Tag Config Example:

Tag type : Universal Analytics
Track type : Event
Event Category: Ecommerce
Event Action: Checkout
Enable Enhanced Ecommerce Features: true
Use Data Layer: true
Trigger: event equals csCheckout

Checkout Complete (Purchase):

Tag Config Example:

Tag type : Universal Analytics
Track type : Pageview
Enable Enhanced Ecommerce Features: true
Use Data Layer: true
Trigger: event equals gtm.dom

Remove Item from Cart

Event-Name: csRemoveFromCart

Tag Config Example:

Tag type : Universal Analytics
Track type : Event
Event Category: Ecommerce
Event Action: Remove from Cart
Enable Enhanced Ecommerce Features: true
Use Data Layer: true
Trigger: event equals csRemoveFromCart

Add Item to Cart

Event-Name: csAddToCart

Tag Config Example:

Tag type : Universal Analytics
Track type : Event
Event Category: Ecommerce
Event Action: Add to Cart
Enable Enhanced Ecommerce Features: true
Use Data Layer: true
Trigger: event equals csAddToCart