Skip to content

Commit 675f586

Browse files
committed
MAGE-804 Added configuration for analytics region
1 parent 0247b4c commit 675f586

File tree

4 files changed

+22
-1
lines changed

4 files changed

+22
-1
lines changed

Helper/AnalyticsHelper.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ private function setupAnalyticsClient()
8585
if ($this->analyticsClient) {
8686
return;
8787
}
88-
88+
89+
$this->region = $this->configHelper->getAnalyticsRegion();
8990
$this->analyticsClient = AnalyticsClient::create(
9091
$this->configHelper->getApplicationID(),
9192
$this->configHelper->getAPIKey(),

Helper/ConfigHelper.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1685,6 +1685,19 @@ public function getMaxRecordSizeLimit($storeId = null)
16851685
);
16861686
}
16871687

1688+
/**
1689+
* @param $storeId
1690+
* @return string
1691+
*/
1692+
public function getAnalyticsRegion($storeId = null)
1693+
{
1694+
return $this->configInterface->getValue(
1695+
self::ANALYTICS_REGION,
1696+
ScopeInterface::SCOPE_STORE,
1697+
$storeId
1698+
);
1699+
}
1700+
16881701
/**
16891702
* @param $storeId
16901703
* @return bool

etc/adminhtml/system.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,6 +1259,12 @@
12591259
If your Algolia plan allows a higher record size limit, you can customize the record size limit.]]>
12601260
</comment>
12611261
</field>
1262+
<field id="analytics_region" translate="label comment" type="text" sortOrder="96" showInDefault="1">
1263+
<label>Analytics Region</label>
1264+
<comment>
1265+
<![CDATA[Default value is 'us']]>
1266+
</comment>
1267+
</field>
12621268
</group>
12631269
<group id="queue" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
12641270
<label>Indexing Queue</label>

etc/config.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
<algoliasearch_advanced>
8282
<advanced>
8383
<max_record_size_limit>10000</max_record_size_limit>
84+
<analytics_region>us</analytics_region>
8485
</advanced>
8586
<queue>
8687
<number_of_element_by_page>300</number_of_element_by_page>

0 commit comments

Comments
 (0)