Skip to content

Commit 4326b67

Browse files
committed
After-Review-10738-Third-Party-Google-Analytics-and-AdWords
1 parent fce1bbc commit 4326b67

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

Model/Config.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class Config
5959
* Speed optimization config
6060
*/
6161
public const XML_PATH_SPEED_OPTIMIZATION_ENABLED = 'mfgoogletagmanager/page_speed_optimization/enabled';
62-
public const XML_PATH_GOOGLE_ANALYTICS_AND_ADWORDS = 'mfgoogletagmanager/google_analytics_and_adwords/enabled';
62+
public const XML_PATH_THIRD_PARTY_GA = 'mfgoogletagmanager/third_party_ga/enabled';
6363

6464
/**
6565
* @var ScopeConfigInterface
@@ -306,8 +306,8 @@ public function isSpeedOptimizationEnabled(string $storeId = null): bool
306306
* @param string|null $storeId
307307
* @return bool
308308
*/
309-
public function isGoogleAnalyticsAndAdWordsEnabled(string $storeId = null): bool
309+
public function isThirdPartyGaEnabled(string $storeId = null): bool
310310
{
311-
return (bool)$this->getConfig(self::XML_PATH_GOOGLE_ANALYTICS_AND_ADWORDS, $storeId);
311+
return (bool)$this->getConfig(self::XML_PATH_THIRD_PARTY_GA, $storeId);
312312
}
313313
}

Plugin/Magento/Framework/App/Config/ScopeConfig.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ public function afterGetValue(
4848
$scopeCode = null
4949
)
5050
{
51-
if (in_array($path,self::PATHS)) {
52-
if ($this->config->isEnabled() && !$this->config->isGoogleAnalyticsAndAdWordsEnabled()) {
51+
if (in_array($path, self::PATHS)) {
52+
if ($this->config->isEnabled() && !$this->config->isThirdPartyGaEnabled()) {
5353
$result = '0';
5454
}
5555
}

etc/adminhtml/system.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ To create a new secret, navigate in the
370370
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
371371
</field>
372372
</group>
373-
<group id="google_analytics_and_adwords" translate="label" type="text" sortOrder="65" showInDefault="1" showInWebsite="1" showInStore="1">
373+
<group id="third_party_ga" translate="label" type="text" sortOrder="65" showInDefault="1" showInWebsite="1" showInStore="1">
374374
<label>Third-Party Google Analytics and AdWords</label>
375375
<field id="enabled" translate="label comment" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
376376
<label>Enable</label>

etc/config.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@
7171
<page_speed_optimization>
7272
<enabled>0</enabled>
7373
</page_speed_optimization>
74-
<google_analytics_and_adwords>
74+
<third_party_ga>
7575
<enabled>0</enabled>
76-
</google_analytics_and_adwords>
76+
</third_party_ga>
7777
<customer_data>
7878
<protect>0</protect>
7979
<load_before_consent>0</load_before_consent>

0 commit comments

Comments
 (0)