Add Google Search Console verification and ensure all Google services coexist
- Add googlesitekey param to Google fieldset in templateDetails.xml - Inject <meta name="google-site-verification"> via setMetaData() in index.php, component.php, and offline.php - GTM, GA, and Search Console verification can now all be active simultaneously - Add language strings for new field in en-US and en-GB Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -37,6 +37,11 @@ $params_googletagmanager = $this->params->get('googletagmanager', false);
|
||||
$params_googletagmanagerid = $this->params->get('googletagmanagerid', null);
|
||||
$params_googleanalytics = $this->params->get('googleanalytics', false);
|
||||
$params_googleanalyticsid = $this->params->get('googleanalyticsid', null);
|
||||
$params_googlesitekey = $this->params->get('googlesitekey', null);
|
||||
|
||||
if (!empty($params_googlesitekey)) {
|
||||
$this->setMetaData('google-site-verification', htmlspecialchars($params_googlesitekey, ENT_QUOTES, 'UTF-8'));
|
||||
}
|
||||
|
||||
// Detecting Active Variables
|
||||
$option = $input->getCmd('option', '');
|
||||
|
||||
@@ -53,6 +53,7 @@ $params_googletagmanager = $this->params->get('googletagmanager', false);
|
||||
$params_googletagmanagerid = $this->params->get('googletagmanagerid', null);
|
||||
$params_googleanalytics = $this->params->get('googleanalytics', false);
|
||||
$params_googleanalyticsid = $this->params->get('googleanalyticsid', null);
|
||||
$params_googlesitekey = $this->params->get('googlesitekey', null);
|
||||
$params_custom_head_start = $this->params->get('custom_head_start', null);
|
||||
$params_custom_head_end = $this->params->get('custom_head_end', null);
|
||||
$params_developmentmode = $this->params->get('developmentmode', false);
|
||||
@@ -188,6 +189,9 @@ $stickyHeader = $this->params->get('stickyHeader') ? 'position-sticky sticky-top
|
||||
|
||||
// Meta
|
||||
$this->setMetaData('viewport', 'width=device-width, initial-scale=1');
|
||||
if (!empty($params_googlesitekey)) {
|
||||
$this->setMetaData('google-site-verification', htmlspecialchars($params_googlesitekey, ENT_QUOTES, 'UTF-8'));
|
||||
}
|
||||
|
||||
if ($this->params->get('fA6KitCode')) {
|
||||
$faKit = "https://kit.fontawesome.com/" . $this->params->get('fA6KitCode') . ".js";
|
||||
|
||||
@@ -47,6 +47,8 @@ TPL_MOKOCASSIOPEIA_GOOGLEANALYTICS_LABEL="Use Google Analytics?"
|
||||
TPL_MOKOCASSIOPEIA_GOOGLEANALYTICS_DESC="Do you want to use Google Analytics?<br>More information on Google Analytics can be found <a target='_blank' href='https://developers.google.com/analytics'>here.</a>"
|
||||
TPL_MOKOCASSIOPEIA_GOOGLEANALYTICSID_LABEL="Google Analytics ID"
|
||||
TPL_MOKOCASSIOPEIA_GOOGLEANALYTICSID_DESC="Begins with 'G-'"
|
||||
TPL_MOKOCASSIOPEIA_GOOGLESITEKEY_LABEL="Google Search Console Verification"
|
||||
TPL_MOKOCASSIOPEIA_GOOGLESITEKEY_DESC="Paste the content value from the <meta name="google-site-verification"> tag. Find this in Google Search Console under Ownership Verification → HTML tag method."
|
||||
|
||||
; ===== Branding & icons (Theme tab) =====
|
||||
TPL_MOKOCASSIOPEIA_BRAND_LABEL="Brand"
|
||||
|
||||
@@ -47,6 +47,8 @@ TPL_MOKOCASSIOPEIA_GOOGLEANALYTICS_LABEL="Use Google Analytics?"
|
||||
TPL_MOKOCASSIOPEIA_GOOGLEANALYTICS_DESC="Do you want to use Google Analytics?<br>More information on Google Analytics can be found <a target='_blank' href='https://developers.google.com/analytics'>here.</a>"
|
||||
TPL_MOKOCASSIOPEIA_GOOGLEANALYTICSID_LABEL="Google Analytics ID"
|
||||
TPL_MOKOCASSIOPEIA_GOOGLEANALYTICSID_DESC="Begins with 'G-'"
|
||||
TPL_MOKOCASSIOPEIA_GOOGLESITEKEY_LABEL="Google Search Console Verification"
|
||||
TPL_MOKOCASSIOPEIA_GOOGLESITEKEY_DESC="Paste the content value from the <meta name="google-site-verification"> tag. Find this in Google Search Console under Ownership Verification → HTML tag method."
|
||||
|
||||
; ===== Branding & icons (Theme tab) =====
|
||||
TPL_MOKOCASSIOPEIA_BRAND_LABEL="Brand"
|
||||
|
||||
@@ -134,6 +134,11 @@ $params_googletagmanager = $params->get('googletagmanager', false);
|
||||
$params_googletagmanagerid = $params->get('googletagmanagerid', null);
|
||||
$params_googleanalytics = $params->get('googleanalytics', false);
|
||||
$params_googleanalyticsid = $params->get('googleanalyticsid', null);
|
||||
$params_googlesitekey = $params->get('googlesitekey', null);
|
||||
|
||||
if (!empty($params_googlesitekey)) {
|
||||
$doc->setMetaData('google-site-verification', htmlspecialchars($params_googlesitekey, ENT_QUOTES, 'UTF-8'));
|
||||
}
|
||||
|
||||
/* -----------------------
|
||||
Login routes & Users
|
||||
|
||||
@@ -124,6 +124,7 @@
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field name="googleanalyticsid" type="text" default="" label="TPL_MOKOCASSIOPEIA_GOOGLEANALYTICSID_LABEL" description="TPL_MOKOCASSIOPEIA_GOOGLEANALYTICSID_DESC" filter="string" showon="googleanalytics:1" />
|
||||
<field name="googlesitekey" type="text" default="" label="TPL_MOKOCASSIOPEIA_GOOGLESITEKEY_LABEL" description="TPL_MOKOCASSIOPEIA_GOOGLESITEKEY_DESC" filter="string" />
|
||||
</fieldset>
|
||||
|
||||
<!-- Custom Code tab -->
|
||||
|
||||
Reference in New Issue
Block a user