Model
GtagConfig
Magento\GoogleGtag\Model\Config\GtagConfig
What it does
This class provides configuration management for Google Analytics 4 (GA4) and Google AdWords/Gtag integration in Magento 2.
Developers use it to check if these services are enabled, retrieve measurement IDs, conversion IDs/labels, and get the Google Tag Manager script URLs needed for tracking and conversion tracking implementation.
Public Methods
- isGoogleAnalyticsAvailable()
- getMeasurementId()
- isGoogleAdwordsActive()
- isGoogleAdwordsConfigurable()
- getConversionGtagGlobalSiteTagSrc()
- getConversionId()
- getConversionLabel()