Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure Analytics category is always shown at top, #PG-4052 #988

Merged
merged 4 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions API/TemplateMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ public function formatTemplates($templates)
});
}

$analyticsCategoryName = Piwik::translate('TagManager_CategoryAnalytics');
$analyticsCategoryIndex = array_search($analyticsCategoryName, array_column($byCategory, 'name'));
if (!empty($byCategory[$analyticsCategoryIndex])) {
$analyticsCategory = $byCategory[$analyticsCategoryIndex];
unset($byCategory[$analyticsCategoryIndex]);
$byCategory = array_merge([$analyticsCategory], $byCategory);
}

return $byCategory;
}
}
1 change: 1 addition & 0 deletions Template/Variable/BaseVariable.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ abstract class BaseVariable extends BaseTemplate
public const CATEGORY_DEVICE = 'TagManager_CategoryDevice';
public const CATEGORY_SEO = 'TagManager_CategorySEO';
public const CATEGORY_OTHERS = 'General_Others';
public const CATEGORY_ANALYTICS = 'TagManager_CategoryAnalytics';

protected $templateType = 'Variable';

Expand Down
2 changes: 1 addition & 1 deletion Template/Variable/MatomoConfigurationVariable.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function getId()

public function getCategory()
{
return self::CATEGORY_OTHERS;
return self::CATEGORY_ANALYTICS;
}

public function getIcon()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,159 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<result>
<row>
<name>Ads</name>
<types>
<row>
<id>BingUET</id>
<name>Bing Ads UET Tag</name>
<description>Adds the Bing Ads Universal Event Tracking Tag to your website so you can apply conversion tracking to your Bing ad campaigns.</description>
<category>Ads</category>
<icon>plugins/TagManager/images/icons/bing.svg</icon>
<help>The tag tracks what your customers are doing after they click on your Bing ad.</help>
<order>9999</order>
<contexts>
<row>web</row>
</contexts>
<hasAdvancedSettings>1</hasAdvancedSettings>
<isCustomTemplate>0</isCustomTemplate>
<parameters>
<row>
<name>bingAdID</name>
<title>ID</title>
<value />
<defaultValue />
<type>string</type>
<uiControl>text</uiControl>
<uiControlAttributes>
<placeholder>e.g. 1234567890</placeholder>
</uiControlAttributes>
<availableValues />
<description>You can find the Bing Ad ID when creating a new tracking code in the Bing Ad Campaign Manager.</description>
<inlineHelp />
<introduction />
<condition />
<fullWidth>0</fullWidth>
</row>
</parameters>
</row>
<row>
<id>GoogleAdsConversion</id>
<name>Google Ads: Conversion</name>
<description>Send an event to track conversions. This tag requires Google Tag (gtag.js) tag to be configured.</description>
<category>Ads</category>
<icon>plugins/TagManager/images/icons/google-ads.svg</icon>
<help />
<order>9999</order>
<contexts>
<row>web</row>
</contexts>
<hasAdvancedSettings>1</hasAdvancedSettings>
<isCustomTemplate>0</isCustomTemplate>
<parameters>
<row>
<name>googleAdsConversionId</name>
<title>Conversion ID</title>
<value />
<defaultValue />
<type>string</type>
<uiControl>text</uiControl>
<uiControlAttributes>
</uiControlAttributes>
<availableValues />
<description />
<inlineHelp>To find the Conversion ID, &lt;a href=&quot;https://support.google.com/tagmanager/answer/6105160&quot; target=&quot;_blank&quot; rel=&quot;noreferrer noopener&quot;&gt;see Google Ads Conversion Tracking&lt;a&gt;.</inlineHelp>
<introduction />
<condition />
<fullWidth>0</fullWidth>
<component>
<plugin>TagManager</plugin>
<name>FieldVariableTemplate</name>
</component>
</row>
<row>
<name>googleAdsConversionLabel</name>
<title>Conversion label</title>
<value />
<defaultValue />
<type>string</type>
<uiControl>text</uiControl>
<uiControlAttributes>
</uiControlAttributes>
<availableValues />
<description />
<inlineHelp>To find the Conversion Label, &lt;a href=&quot;https://support.google.com/tagmanager/answer/6105160&quot; target=&quot;_blank&quot; rel=&quot;noreferrer noopener&quot;&gt;see Google Ads Conversion Tracking&lt;a&gt;.</inlineHelp>
<introduction />
<condition />
<fullWidth>0</fullWidth>
<component>
<plugin>TagManager</plugin>
<name>FieldVariableTemplate</name>
</component>
</row>
<row>
<name>googleAdsConversionValue</name>
<title>Conversion value</title>
<value />
<defaultValue />
<type>string</type>
<uiControl>text</uiControl>
<uiControlAttributes>
</uiControlAttributes>
<availableValues />
<description />
<inlineHelp />
<introduction />
<condition />
<fullWidth>0</fullWidth>
<component>
<plugin>TagManager</plugin>
<name>FieldVariableTemplate</name>
</component>
</row>
<row>
<name>googleAdsConversionTransactionId</name>
<title>Transaction ID</title>
<value />
<defaultValue />
<type>string</type>
<uiControl>text</uiControl>
<uiControlAttributes>
</uiControlAttributes>
<availableValues />
<description />
<inlineHelp>Passing a dynamic transaction ID helps avoid double counting conversions. The transaction ID must be unique for each transaction. The transaction IDs must not include any information that could be used to identify individual customers. &lt;a href=&quot;https://support.google.com/google-ads/answer/6386790&quot; target=&quot;_blank&quot; rel=&quot;noreferrer noopener&quot;&gt;Learn more&lt;a&gt;.</inlineHelp>
<introduction />
<condition />
<fullWidth>0</fullWidth>
<component>
<plugin>TagManager</plugin>
<name>FieldVariableTemplate</name>
</component>
</row>
<row>
<name>googleAdsConversionCurrency</name>
<title>Currency code</title>
<value />
<defaultValue />
<type>string</type>
<uiControl>text</uiControl>
<uiControlAttributes>
</uiControlAttributes>
<availableValues />
<description />
<inlineHelp />
<introduction />
<condition />
<fullWidth>0</fullWidth>
<component>
<plugin>TagManager</plugin>
<name>FieldVariableTemplate</name>
</component>
</row>
</parameters>
</row>
</types>
</row>
<row>
<name>Analytics</name>
<types>
Expand Down Expand Up @@ -1472,6 +1318,160 @@
</row>
</types>
</row>
<row>
<name>Ads</name>
<types>
<row>
<id>BingUET</id>
<name>Bing Ads UET Tag</name>
<description>Adds the Bing Ads Universal Event Tracking Tag to your website so you can apply conversion tracking to your Bing ad campaigns.</description>
<category>Ads</category>
<icon>plugins/TagManager/images/icons/bing.svg</icon>
<help>The tag tracks what your customers are doing after they click on your Bing ad.</help>
<order>9999</order>
<contexts>
<row>web</row>
</contexts>
<hasAdvancedSettings>1</hasAdvancedSettings>
<isCustomTemplate>0</isCustomTemplate>
<parameters>
<row>
<name>bingAdID</name>
<title>ID</title>
<value />
<defaultValue />
<type>string</type>
<uiControl>text</uiControl>
<uiControlAttributes>
<placeholder>e.g. 1234567890</placeholder>
</uiControlAttributes>
<availableValues />
<description>You can find the Bing Ad ID when creating a new tracking code in the Bing Ad Campaign Manager.</description>
<inlineHelp />
<introduction />
<condition />
<fullWidth>0</fullWidth>
</row>
</parameters>
</row>
<row>
<id>GoogleAdsConversion</id>
<name>Google Ads: Conversion</name>
<description>Send an event to track conversions. This tag requires Google Tag (gtag.js) tag to be configured.</description>
<category>Ads</category>
<icon>plugins/TagManager/images/icons/google-ads.svg</icon>
<help />
<order>9999</order>
<contexts>
<row>web</row>
</contexts>
<hasAdvancedSettings>1</hasAdvancedSettings>
<isCustomTemplate>0</isCustomTemplate>
<parameters>
<row>
<name>googleAdsConversionId</name>
<title>Conversion ID</title>
<value />
<defaultValue />
<type>string</type>
<uiControl>text</uiControl>
<uiControlAttributes>
</uiControlAttributes>
<availableValues />
<description />
<inlineHelp>To find the Conversion ID, &lt;a href=&quot;https://support.google.com/tagmanager/answer/6105160&quot; target=&quot;_blank&quot; rel=&quot;noreferrer noopener&quot;&gt;see Google Ads Conversion Tracking&lt;a&gt;.</inlineHelp>
<introduction />
<condition />
<fullWidth>0</fullWidth>
<component>
<plugin>TagManager</plugin>
<name>FieldVariableTemplate</name>
</component>
</row>
<row>
<name>googleAdsConversionLabel</name>
<title>Conversion label</title>
<value />
<defaultValue />
<type>string</type>
<uiControl>text</uiControl>
<uiControlAttributes>
</uiControlAttributes>
<availableValues />
<description />
<inlineHelp>To find the Conversion Label, &lt;a href=&quot;https://support.google.com/tagmanager/answer/6105160&quot; target=&quot;_blank&quot; rel=&quot;noreferrer noopener&quot;&gt;see Google Ads Conversion Tracking&lt;a&gt;.</inlineHelp>
<introduction />
<condition />
<fullWidth>0</fullWidth>
<component>
<plugin>TagManager</plugin>
<name>FieldVariableTemplate</name>
</component>
</row>
<row>
<name>googleAdsConversionValue</name>
<title>Conversion value</title>
<value />
<defaultValue />
<type>string</type>
<uiControl>text</uiControl>
<uiControlAttributes>
</uiControlAttributes>
<availableValues />
<description />
<inlineHelp />
<introduction />
<condition />
<fullWidth>0</fullWidth>
<component>
<plugin>TagManager</plugin>
<name>FieldVariableTemplate</name>
</component>
</row>
<row>
<name>googleAdsConversionTransactionId</name>
<title>Transaction ID</title>
<value />
<defaultValue />
<type>string</type>
<uiControl>text</uiControl>
<uiControlAttributes>
</uiControlAttributes>
<availableValues />
<description />
<inlineHelp>Passing a dynamic transaction ID helps avoid double counting conversions. The transaction ID must be unique for each transaction. The transaction IDs must not include any information that could be used to identify individual customers. &lt;a href=&quot;https://support.google.com/google-ads/answer/6386790&quot; target=&quot;_blank&quot; rel=&quot;noreferrer noopener&quot;&gt;Learn more&lt;a&gt;.</inlineHelp>
<introduction />
<condition />
<fullWidth>0</fullWidth>
<component>
<plugin>TagManager</plugin>
<name>FieldVariableTemplate</name>
</component>
</row>
<row>
<name>googleAdsConversionCurrency</name>
<title>Currency code</title>
<value />
<defaultValue />
<type>string</type>
<uiControl>text</uiControl>
<uiControlAttributes>
</uiControlAttributes>
<availableValues />
<description />
<inlineHelp />
<introduction />
<condition />
<fullWidth>0</fullWidth>
<component>
<plugin>TagManager</plugin>
<name>FieldVariableTemplate</name>
</component>
</row>
</parameters>
</row>
</types>
</row>
<row>
<name>Consent Management</name>
<types>
Expand Down Expand Up @@ -2539,4 +2539,4 @@
</row>
</types>
</row>
</result>
</result>
Loading
Loading