Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

GA Push

Security covered Under active development 481 sites

This module allows you to send data to Google Analytics using GA4 or DataLayer push types. It supports various tracking methods including pageviews, events, and e-commerce data, with options for both client-side and server-side tracking.

Supported Push types

You can implement your own methods to communicate with GA.

Google nowadays let you communicate to analytics with the current push types:

Push types GA4 DataLayer Pageview Event Ecommerce Enhanced Ecommerce Social Exceptions

Features:

  • Client and Server side tracking. You can choose which mode better fits your needs!

Dependencies:

Modules that uses ga_push as dependency

Please let us know about new modules that uses GA Push!

Changes Introduced in 2.x Version

We removed the deprecated methods from GA, introduced the GA4 method and kept Datalayer.

We keep the same event types.

We keep the functions:
ga_push_add_ecommerce()
ga_push_add_event()
ga_push_add_pageview()
ga_push_add_social()

Removed options parameter from ga_push_add.

The following properties are not supported on GA4 service:

- *     - 'tid': Override Tracking ID / Web Property ID (Classic User account
- *       aka UA)
- *       of the google analytics module config.
- *       Universal and Classic GA Methods.
- *     - 'cid': Override Universal Client ID of the current user cookie.
- *       Only for Universal GA methods.
- *     - 'utma': Force Classic GA __utma cookie of the current user cookie
- *       Only for Classic GA methods.
- *     - 'utmb': Force Classic GA __utmb cookie of the current user cookie
- *       Only for Classic GA methods.
- *     - 'ua': Override User Agent of the current user.
- *       Only for Universal GA methods.
- *     - 'uip': Override User IP of the current user.
- *       Only for Universal GA methods.

We remove the includes and use services instead.
Example GA4:

/** @var \Drupal\ga_push\GA4MPService $ga4mpService **/
$ga4mpService = \Drupal::service('ga_push.ga4mp');
 
$form_url = 'https://example.com/your-form';
 
// Create the event data array
$event_data = [
  'eventCategory' => 'LandingPage',
  'eventAction' => 'Submit',
  'eventLabel' => $form_url,
];
 
// Send the event
$ga4mpService->sendEvent($event_data, 'GA_PUSH_TYPE_EVENT');

Datalayer:

/** @var \Drupal\ga_push\DataLayerService $datalayerService **/
$datalayerService = \Drupal::service('ga_push.datalayer');

$form_url = 'https://example.com/your-form';

// Create the event data array
$event_data = [
  'event' => 'GAEvent',
  'eventCategory' => 'LandingPage',
  'eventAction' => 'Submit',
  'eventLabel' => $form_url,
];

// Send the event
$datalayerService->pushData($event_data, 'GA_PUSH_TYPE_EVENT');

Or use the functions ga_push_add*

Credits
Initial development by GeduR.
Development of this module is sponsored by Metadrop.

Ask your assistant about GA Push

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

1 tracked project depends on this one

Activity

Tracked releases
5
Tracked since
Mar 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 5
Maintenance
Dormant

Release Timeline

Releases

Version Type Core PHP Release date
2.0.0-alpha3 Pre-release 10–11 Mar 10, 2025
2.0.0-alpha2 Pre-release 10–11 Mar 10, 2025
2.0.0-alpha1 Pre-release 10–11 Mar 10, 2025
3.0.0-alpha1 Pre-release 10–11 Mar 10, 2025
3.x-dev Dev 10–11 Mar 7, 2025