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

Hides the GA4 Tag when trying to create a new tag, #PG-3996 #967

Merged
merged 5 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from 4 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
2 changes: 1 addition & 1 deletion Template/Tag/GoogleAnalytics4EventTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function getDescription()
// By default, the description will be automatically fetched from the TagManager_CustomHtmlTagDescription
// translation key. you can either adjust/create/remove this translation key, or return a different value
// here directly.
return parent::getDescription();
return Piwik::translate('TagManager_GoogleAnalytics4EventTagDescriptionNew');
}

public function getHelp()
Expand Down
1 change: 1 addition & 0 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -984,6 +984,7 @@
"GoogleAnalytics4MeasurementIdDescription": "Input your Measurement ID. %1$sLearn more%2$s.",
"GoogleAnalytics4EventTagName": "Google Analytics: GA4 Event",
"GoogleAnalytics4EventTagDescription": "Send an event to Google Analytics 4. This tag requires Google analytics 4 (GA4) tag to be configured.",
"GoogleAnalytics4EventTagDescriptionNew": "Send an event to Google Analytics 4. This tag requires Google Tag (gtag.js) tag to be configured.",
"GoogleAnalytics4EventTagHelp": "",
"GoogleAnalytics4EventNameTitle": "Event name",
"GoogleAnalytics4EventNameDescription": "Specify the name of the event. %1$sLearn more%2$s.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@
<row>
<id>GoogleAnalytics4Event</id>
<name>Google Analytics: GA4 Event</name>
<description>Send an event to Google Analytics 4. This tag requires Google analytics 4 (GA4) tag to be configured.</description>
<description>Send an event to Google Analytics 4. This tag requires Google Tag (gtag.js) tag to be configured.</description>
<category>Analytics</category>
<icon>plugins/TagManager/images/icons/google-analytics-4.svg</icon>
<help />
Expand Down
4 changes: 2 additions & 2 deletions tests/UI/expected-screenshots/ContainerTag_create_new.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
123 changes: 65 additions & 58 deletions vue/dist/TagManager.umd.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions vue/dist/TagManager.umd.min.js

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions vue/src/Tag/TagEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@
:key="index"
class="collection-item avatar"
@click="createTagType(tagTemplate)"
v-show="isTagVisible(tagTemplate.id)"
:class="{
disabledTemplate: isTagTemplateDisabled[tagTemplate.id],
[`templateType${ tagTemplate.id}`]: true,
Expand Down Expand Up @@ -784,6 +785,13 @@ export default defineComponent({
hasPublishCapability() {
return Matomo.hasUserCapability('tagmanager_write') && Matomo.hasUserCapability('tagmanager_use_custom_templates');
},
isTagVisible(id: string) {
if (this.create && id === 'GoogleAnalytics4') {
return false;
}

return true;
},
},
computed: {
availableFireLimits() {
Expand Down
Loading