Ghost/ghost/admin/app/components/settings/analytics.js
Simon Backx e879406659
Added outbound link tagging setting (#16146)
fixes https://github.com/TryGhost/Team/issues/2432
    
Adds outbound_link_tagging setting (enabled by default and behind
feature flag). If the feature flag is enabled, and the setting is
disabled, we won't add ?ref to links in emails.
    
This includes new E2E tests for email click tracking, which were also
extended to check outbound link tagging (for both MEGA and the new email
stability flow).

Also fixes a test fixture for the comments_enabled setting.
2023-01-20 13:41:36 +01:00

41 lines
1.0 KiB
JavaScript

import Component from '@glimmer/component';
import {action} from '@ember/object';
import {inject as service} from '@ember/service';
export default class Analytics extends Component {
@service settings;
@service feature;
@action
toggleEmailTrackOpens(event) {
if (event) {
event.preventDefault();
}
this.settings.emailTrackOpens = !this.settings.emailTrackOpens;
}
@action
toggleEmailTrackClicks(event) {
if (event) {
event.preventDefault();
}
this.settings.emailTrackClicks = !this.settings.emailTrackClicks;
}
@action
toggleMembersTrackSources(event) {
if (event) {
event.preventDefault();
}
this.settings.membersTrackSources = !this.settings.membersTrackSources;
}
@action
toggleOutboundLinkTagging(event) {
if (event) {
event.preventDefault();
}
this.settings.outboundLinkTagging = !this.settings.outboundLinkTagging;
}
}