Skip to content

Provides the ability to connect various telemetry systems such as google analytics, yandex metrika

License

Notifications You must be signed in to change notification settings

maksze/MaksZeTelemetryBundle

Repository files navigation

MaksZeTelemetryBundle

Provides the ability to connect various telemetry systems such as google analytics, yandex metrika, ect

Build Status Latest Stable Version Total Downloads

Motivation

You can simply connect the file with the metric code in prod mode. Roughly so:

{% if not debug %}
  {% include 'telemetry.twig' %}
{% endif %}

but with bundle, it's much more fun)

Installation

Open a command console, enter your project directory and execute the following command to download the latest version of this bundle:

composer require maksze/telemetry-bundle

Configuration

To make this bundle work you need to add the following to your app/config/packages/maksze_telemetry.yaml:

# app/config/packages/maksze_telemetry.yaml

maksze_telemetry:
  yandex_metrika:
    - {id: any_id}
  yandex_webmaster:
    - {id: any_id}
  google_search_console:
    - {id: any_id}
  google_analytics:
    - {id: any_id}
  facebook_pixel:
    - {id: any_id}

Add app/config/routes/maksze_telemetry.yaml

# app/config/routes/maksze_telemetry.yaml

_maksze_telemetry:
  resource: '@MaksZeTelemetryBundle/Resources/config/routes.xml'
  prefix: /

Add to the main template before the closing body tag

{{ maksze_telemetry_render() }}

About

Provides the ability to connect various telemetry systems such as google analytics, yandex metrika

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published