All Collections
Market
Analytics
Sending Amplitude and Google Analytics events
Sending Amplitude and Google Analytics events
Andrew avatar
Written by Andrew
Updated over a week ago

Sending events for Amplitude-analytics and Google Analytics happens in controllers or js scripts

In the controllers looks like this:

$this->analytics->track('user_modal_login_success', ['controller' => 'users']);

In js:

sendAnalytics('dp_user_profile_btn_edit_field', 'my_profile', 'user');

For Amplitude to be connected correctly and quickly you need to do this via .env.production (at the root of the product)

The amplitude key is assigned to the AMPLITUDE_KEY variable

Choose a project

Also make sure that the variable ANALYTICS_PROFILES = basic, user_extended, admin_extended

To make sure that events are being sent, you can see the requests being sent in the browser of the developer tool (in the Network section)

To configure and activate GA it is enough to add an identifier through the admin panel

In the Tracker code field it is desirable to add only Yandex-metrics (if it is needed)

Did this answer your question?