diff --git a/ghost/admin/app/components/member/activity-feed.hbs b/ghost/admin/app/components/member/activity-feed.hbs
index 1a811f92ff..8c22e50d03 100644
--- a/ghost/admin/app/components/member/activity-feed.hbs
+++ b/ghost/admin/app/components/member/activity-feed.hbs
@@ -31,11 +31,11 @@
{{/if}}
{{#if event.url}}
{{event.join}}
- {{#if (feature "emailClicks")}}– {{/if}}
+ –
{{event.object}}
{{/if}}
{{#if event.email}}
- {{#if (feature "emailClicks")}}– {{/if}}
+ –
{{/if}}
diff --git a/ghost/admin/app/components/members-activity/table-row.hbs b/ghost/admin/app/components/members-activity/table-row.hbs
index b5abe3dc9a..d5a4aea3b8 100644
--- a/ghost/admin/app/components/members-activity/table-row.hbs
+++ b/ghost/admin/app/components/members-activity/table-row.hbs
@@ -26,11 +26,11 @@
{{/if}}
{{#if event.url}}
{{event.join}}
- {{#if (feature "emailClicks")}}– {{/if}}
+ –
{{event.object}}
{{/if}}
{{#if event.email}}
- {{#if (feature "emailClicks")}}– {{/if}}
+ –
{{/if}}
diff --git a/ghost/admin/app/components/members/filter.js b/ghost/admin/app/components/members/filter.js
index 36f49517bb..6ec815a6a9 100644
--- a/ghost/admin/app/components/members/filter.js
+++ b/ghost/admin/app/components/members/filter.js
@@ -31,9 +31,9 @@ const FILTER_PROPERTIES = [
{label: 'Emails sent (all time)', name: 'email_count', group: 'Email'},
{label: 'Emails opened (all time)', name: 'email_opened_count', group: 'Email'},
{label: 'Open rate (all time)', name: 'email_open_rate', group: 'Email'},
- {label: 'Received email', name: 'emails.post_id', group: 'Email', valueType: 'array', feature: 'emailClicks'},
- {label: 'Opened email', name: 'opened_emails.post_id', group: 'Email', valueType: 'array', feature: 'emailClicks'},
- {label: 'Clicked email', name: 'clicked_links.post_id', group: 'Email', valueType: 'array', feature: 'emailClicks'}
+ {label: 'Received email', name: 'emails.post_id', group: 'Email', valueType: 'array'},
+ {label: 'Opened email', name: 'opened_emails.post_id', group: 'Email', valueType: 'array'},
+ {label: 'Clicked email', name: 'clicked_links.post_id', group: 'Email', valueType: 'array'}
// {label: 'Emails sent (30 days)', name: 'x', group: 'Email'},
// {label: 'Emails opened (30 days)', name: 'x', group: 'Email'},
diff --git a/ghost/admin/app/components/posts-list/list-item-clicks.hbs b/ghost/admin/app/components/posts-list/list-item-clicks.hbs
deleted file mode 100644
index 5ed3771658..0000000000
--- a/ghost/admin/app/components/posts-list/list-item-clicks.hbs
+++ /dev/null
@@ -1,208 +0,0 @@
-{{!-- template-lint-disable no-invalid-interactive --}}
-
-
- {{!-- Title column --}}
- {{#if (and this.session.user.isContributor @post.isPublished)}}
-
-
- {{@post.title}} {{svg-jar "external" class="gh-post-list-external"}}
-
- {{#unless @hideAuthor }}
-
-
- By {{post-author-names @post}}
-
- {{#if @post.primaryTag}}
- in {{@post.primaryTag.name}}
- {{/if}}
-
- -
-
-
- {{#if this.isHovered}}
- {{gh-format-post-time @post.updatedAtUTC format="D MMM YYYY"}}
- {{else}}
- {{gh-format-post-time @post.updatedAtUTC draft=true}}
- {{/if}}
-
-
-
-
- Published
- {{#if @post.hasEmail}}
- {{#if this.isHovered}}
- and sent to {{gh-pluralize @post.email.emailCount "member"}}
- {{else}}
- and sent
- {{/if}}
- {{/if}}
-
-
- {{/unless}}
-
- {{else}}
-
-
- {{@post.title}}
- {{#if @post.lexical}}
- L
- {{/if}}
-
- {{#unless @hideAuthor }}
-
-
- By {{post-author-names @post}}
-
- {{#if @post.primaryTag}}
- in {{@post.primaryTag.name}}
- {{/if}}
- -
-
-
- {{gh-format-post-time @post.updatedAtUTC draft=true}}
- {{#if this.isDateHovered}}
- on {{gh-format-post-time @post.updatedAtUTC format="D MMM YYYY"}}
- {{/if}}
-
- {{!-- {{#if @post.lexical}}
- – Lexical
- {{/if}} --}}
-
-
- {{#if @post.isScheduled}}
-
-
- Scheduled
- {{#if this.isStateHovered}}
- to be published {{if @post.newsletter "and sent "}}{{this.scheduledText}} to {{humanize-recipient-filter @post.emailSegment}}
- {{/if}}
-
- {{/if}}
-
- {{#if @post.isDraft}}
-
-
- Draft
-
- {{/if}}
-
- {{#if @post.isPublished}}
-
- Published
- {{#if @post.didEmailFail}}
- but failed to send newsletter
- {{else if @post.hasBeenEmailed}}
- and sent
- {{#if this.isHovered}}
- to {{gh-pluralize @post.email.emailCount "member"}}
- {{/if}}
- {{/if}}
-
- {{/if}}
-
- {{#if @post.isSent}}
-
- {{#if @post.didEmailFail}}
- Failed to send newsletter
- {{else}}
- Sent
- {{#if this.isHovered}}
- to {{gh-pluralize @post.email.emailCount "member"}}
- {{/if}}
- {{/if}}
-
- {{/if}}
-
- {{/unless}}
-
- {{/if}}
-
- {{!-- Opened / Signups column --}}
-
- {{#if (and @post.showEmailOpenAnalytics @post.showEmailClickAnalytics) }}
-
-
- {{#if this.isHovered}}
- {{format-number @post.email.openedCount}}
- {{else}}
- {{@post.email.openRate}}%
- {{/if}}
-
-
- opened
-
-
- {{else if (and @post.isPage @post.showAttributionAnalytics) }}
-
-
- {{@post.count.signups}}
-
-
- signups
-
-
- {{/if}}
-
-
- {{!-- Clicked / Conversions column --}}
-
- {{#unless @post.showEmailClickAnalytics}}
- {{#if @post.showEmailOpenAnalytics }}
-
-
- {{#if this.isHovered}}
- {{format-number @post.email.openedCount}}
- {{else}}
- {{@post.email.openRate}}%
- {{/if}}
-
-
- opened
-
-
- {{/if}}
- {{/unless}}
- {{#if @post.showEmailClickAnalytics }}
-
-
- {{#if this.isHovered}}
- {{format-number @post.count.clicks}}
- {{else}}
- {{@post.clickRate}}%
- {{/if}}
-
-
- clicked
-
-
- {{else if (and @post.isPage @post.showPaidAttributionAnalytics) }}
-
-
- {{@post.count.paid_conversions}}
-
-
- conversions
-
-
- {{/if}}
-
-
- {{!-- Button column --}}
-
-
- {{#if @post.hasAnalyticsPage }}
-
- {{svg-jar "stats" title=""}}
-
- {{else}}
-
- {{svg-jar "pen" title=""}}
-
- {{/if}}
-
-
-
diff --git a/ghost/admin/app/components/posts-list/list-item-clicks.js b/ghost/admin/app/components/posts-list/list-item-clicks.js
deleted file mode 100644
index 9012744a70..0000000000
--- a/ghost/admin/app/components/posts-list/list-item-clicks.js
+++ /dev/null
@@ -1,60 +0,0 @@
-import Component from '@glimmer/component';
-import {action} from '@ember/object';
-import {formatPostTime} from 'ghost-admin/helpers/gh-format-post-time';
-import {inject as service} from '@ember/service';
-import {tracked} from '@glimmer/tracking';
-
-export default class PostsListItemClicks extends Component {
- @service feature;
- @service session;
- @service settings;
-
- @tracked isHovered = false;
-
- get post() {
- return this.args.post;
- }
-
- get errorClass() {
- if (this.post.didEmailFail) {
- return 'error';
- }
- return '';
- }
-
- get scheduledText() {
- let text = [];
-
- let formattedTime = formatPostTime(
- this.post.publishedAtUTC,
- {timezone: this.settings.get('timezone'), scheduled: true}
- );
- text.push(formattedTime);
-
- return text.join(' ');
- }
-
- get routeForLink() {
- if (this.post.hasAnalyticsPage) {
- return 'posts.analytics';
- }
- return 'editor.edit';
- }
-
- get modelsForLink() {
- if (this.post.hasAnalyticsPage) {
- return [this.post];
- }
- return [this.post.displayName, this.post.id];
- }
-
- @action
- mouseOver() {
- this.isHovered = true;
- }
-
- @action
- mouseLeave() {
- this.isHovered = false;
- }
-}
diff --git a/ghost/admin/app/components/posts-list/list-item.hbs b/ghost/admin/app/components/posts-list/list-item.hbs
index 3b19f844c5..5ed3771658 100644
--- a/ghost/admin/app/components/posts-list/list-item.hbs
+++ b/ghost/admin/app/components/posts-list/list-item.hbs
@@ -1,5 +1,5 @@
{{!-- template-lint-disable no-invalid-interactive --}}
-
{{#unless @hideAuthor }}
-
-
- By {{post-author-names @post}}
+
+
+ By {{post-author-names @post}}
{{#if @post.primaryTag}}
in {{@post.primaryTag.name}}
{{/if}}
- • {{gh-format-post-time @post.updatedAtUTC draft=true}}
-
+ -
+
+
+ {{#if this.isHovered}}
+ {{gh-format-post-time @post.updatedAtUTC format="D MMM YYYY"}}
+ {{else}}
+ {{gh-format-post-time @post.updatedAtUTC draft=true}}
+ {{/if}}
+
+
+
+
+ Published
+ {{#if @post.hasEmail}}
+ {{#if this.isHovered}}
+ and sent to {{gh-pluralize @post.email.emailCount "member"}}
+ {{else}}
+ and sent
+ {{/if}}
+ {{/if}}
{{/unless}}
{{else}}
-
+
{{@post.title}}
{{#if @post.lexical}}
@@ -35,194 +53,156 @@
{{/if}}
{{#unless @hideAuthor }}
-
-
- By {{post-author-names @post}}
+
+
+ By {{post-author-names @post}}
{{#if @post.primaryTag}}
in {{@post.primaryTag.name}}
{{/if}}
-
- • {{gh-format-post-time @post.updatedAtUTC draft=true}}
-
+ -
+
+ {{gh-format-post-time @post.updatedAtUTC draft=true}}
+ {{#if this.isDateHovered}}
+ on {{gh-format-post-time @post.updatedAtUTC format="D MMM YYYY"}}
+ {{/if}}
+
+ {{!-- {{#if @post.lexical}}
+ – Lexical
+ {{/if}} --}}
+
+
+ {{#if @post.isScheduled}}
+
+
+ Scheduled
+ {{#if this.isStateHovered}}
+ to be published {{if @post.newsletter "and sent "}}{{this.scheduledText}} to {{humanize-recipient-filter @post.emailSegment}}
+ {{/if}}
+
+ {{/if}}
+
+ {{#if @post.isDraft}}
+
+
+ Draft
+
+ {{/if}}
+
+ {{#if @post.isPublished}}
+
+ Published
+ {{#if @post.didEmailFail}}
+ but failed to send newsletter
+ {{else if @post.hasBeenEmailed}}
+ and sent
+ {{#if this.isHovered}}
+ to {{gh-pluralize @post.email.emailCount "member"}}
+ {{/if}}
+ {{/if}}
+
+ {{/if}}
+
+ {{#if @post.isSent}}
+
+ {{#if @post.didEmailFail}}
+ Failed to send newsletter
+ {{else}}
+ Sent
+ {{#if this.isHovered}}
+ to {{gh-pluralize @post.email.emailCount "member"}}
+ {{/if}}
+ {{/if}}
+
+ {{/if}}
{{/unless}}
{{/if}}
- {{!-- Statuses for when the feature flag for Member Attribution is on only --}}
- {{#if this.feature.memberAttribution}}
- {{#unless @hideStatusColumn }}
- {{#if (and this.session.user.isContributor @post.isPublished)}}
-
-
-
- {{svg-jar "check" class="gh-post-status-icon"}}
- Published
- {{#if @post.hasEmail}}
- & Sent
- {{/if}}
-
-
-
- {{else}}
-
-
- {{#if @post.isScheduled}}
-
- {{svg-jar "clock" class="gh-post-status-icon"}}
- Scheduled
-
- {{/if}}
-
- {{#if @post.isDraft}}
-
- {{svg-jar "pen" class="gh-post-status-icon"}}
- Draft
-
- {{/if}}
-
- {{#if @post.isPublished}}
-
- {{svg-jar "check" class="gh-post-status-icon"}}
- Published
- {{#if @post.hasEmail}}
- & Sent
- {{/if}}
-
- {{/if}}
-
- {{#if @post.isSent}}
-
- {{svg-jar "email-stroke" class="gh-post-status-icon"}}
- Sent
-
- {{/if}}
-
-
- {{/if}}
- {{/unless}}
- {{/if}}
-
- {{#if (and this.feature.memberAttribution (not this.session.user.isContributor)) }}
- {{#if @post.count.signups}}
-
- {{@post.count.signups}}
- {{gh-pluralize @post.count.signups "signup"}}
-
- {{else}}
-
- {{@post.count.signups}}
- {{gh-pluralize @post.count.signups "signup"}}
-
- {{/if}}
- {{/if}}
-
- {{#if (and this.feature.memberAttribution (not this.session.user.isContributor)) }}
- {{#if @post.count.paid_conversions}}
-
- {{@post.count.paid_conversions}}
- {{gh-pluralize @post.count.paid_conversions "conversion"}}
-
- {{else}}
-
- {{@post.count.paid_conversions}}
- {{gh-pluralize @post.count.paid_conversions "conversion"}}
-
- {{/if}}
- {{/if}}
-
- {{!-- Sends/Opens columns --}}
- {{#if (and (not-eq this.settings.membersSignupAccess "none") (not-eq this.settings.editorDefaultEmailRecipients "disabled") (not this.session.user.isContributor))}}
- {{#if (and this.feature.emailAnalytics (eq @post.displayName "post"))}}
- {{!-- Sends column --}}
-
-
- {{#if (eq @post.email.status "submitted")}}
-
- {{format-number @post.email.emailCount}}
- {{gh-pluralize @post.email.emailCount "send"}}
-
+ {{!-- Opened / Signups column --}}
+
+ {{#if (and @post.showEmailOpenAnalytics @post.showEmailClickAnalytics) }}
+
+
+ {{#if this.isHovered}}
+ {{format-number @post.email.openedCount}}
{{else}}
- —
+ {{@post.email.openRate}}%
{{/if}}
-
+
+
+ opened
+
-
- {{!-- Opens column --}}
-
- {{#if (and @post.email.trackOpens (eq @post.email.status "submitted"))}}
-
- {{#if this.feature.memberAttribution}}
-
- {{@post.email.openRate}}%
-
-
- {{else}}
-
- {{#if this.isHovered}}
- {{format-number @post.email.openedCount}}
- {{else}}
- {{@post.email.openRate}}%
- {{/if}}
-
- {{/if}}
- {{@post.email.openRate}}% opens
-
- {{else}}
- —
- {{/if}}
+ {{else if (and @post.isPage @post.showAttributionAnalytics) }}
+
+
+ {{@post.count.signups}}
+
+
+ signups
+
{{/if}}
- {{/if}}
-
- {{!-- Statuses for without the Member Attribution feature flag --}}
- {{#unless this.feature.memberAttribution}}
- {{#unless @hideStatusColumn }}
- {{#if (and this.session.user.isContributor @post.isPublished)}}
-
-
-
- Published
- {{#if @post.hasEmail}}
- {{svg-jar "email-stroke" class="gh-post-status-email"}}
- {{/if}}
-
-
-
- {{else}}
-
-
- {{#if @post.isScheduled}}
-
- Scheduled
-
+
+
+ {{!-- Clicked / Conversions column --}}
+
+ {{#unless @post.showEmailClickAnalytics}}
+ {{#if @post.showEmailOpenAnalytics }}
+
+
+ {{#if this.isHovered}}
+ {{format-number @post.email.openedCount}}
+ {{else}}
+ {{@post.email.openRate}}%
{{/if}}
-
- {{#if @post.isDraft}}
-
- Draft
-
- {{/if}}
-
- {{#if @post.isPublished}}
-
- Published
- {{#if @post.hasEmail}}
- {{svg-jar "email-stroke" class="gh-post-status-email"}}
- {{/if}}
-
- {{/if}}
-
- {{#if @post.isSent}}
-
- {{svg-jar "email-stroke" class="gh-post-status-icon"}}
-
- {{/if}}
-
+
+
+ opened
+
{{/if}}
{{/unless}}
- {{/unless}}
+ {{#if @post.showEmailClickAnalytics }}
+
+
+ {{#if this.isHovered}}
+ {{format-number @post.count.clicks}}
+ {{else}}
+ {{@post.clickRate}}%
+ {{/if}}
+
+
+ clicked
+
+
+ {{else if (and @post.isPage @post.showPaidAttributionAnalytics) }}
+
+
+ {{@post.count.paid_conversions}}
+
+
+ conversions
+
+
+ {{/if}}
+
+
+ {{!-- Button column --}}
+
+
+ {{#if @post.hasAnalyticsPage }}
+
+ {{svg-jar "stats" title=""}}
+
+ {{else}}
+
+ {{svg-jar "pen" title=""}}
+
+ {{/if}}
+
+
diff --git a/ghost/admin/app/components/posts-list/list-item.js b/ghost/admin/app/components/posts-list/list-item.js
index 08d299aeee..9012744a70 100644
--- a/ghost/admin/app/components/posts-list/list-item.js
+++ b/ghost/admin/app/components/posts-list/list-item.js
@@ -4,19 +4,29 @@ import {formatPostTime} from 'ghost-admin/helpers/gh-format-post-time';
import {inject as service} from '@ember/service';
import {tracked} from '@glimmer/tracking';
-export default class PostsListItem extends Component {
+export default class PostsListItemClicks extends Component {
@service feature;
@service session;
@service settings;
@tracked isHovered = false;
+ get post() {
+ return this.args.post;
+ }
+
+ get errorClass() {
+ if (this.post.didEmailFail) {
+ return 'error';
+ }
+ return '';
+ }
+
get scheduledText() {
- let {post} = this.args;
let text = [];
let formattedTime = formatPostTime(
- post.publishedAtUTC,
+ this.post.publishedAtUTC,
{timezone: this.settings.get('timezone'), scheduled: true}
);
text.push(formattedTime);
@@ -24,6 +34,20 @@ export default class PostsListItem extends Component {
return text.join(' ');
}
+ get routeForLink() {
+ if (this.post.hasAnalyticsPage) {
+ return 'posts.analytics';
+ }
+ return 'editor.edit';
+ }
+
+ get modelsForLink() {
+ if (this.post.hasAnalyticsPage) {
+ return [this.post];
+ }
+ return [this.post.displayName, this.post.id];
+ }
+
@action
mouseOver() {
this.isHovered = true;
diff --git a/ghost/admin/app/components/settings/newsletters.hbs b/ghost/admin/app/components/settings/newsletters.hbs
index 84aa1251f9..70727113b9 100644
--- a/ghost/admin/app/components/settings/newsletters.hbs
+++ b/ghost/admin/app/components/settings/newsletters.hbs
@@ -141,89 +141,61 @@
{{/unless}}
- {{#if this.feature.emailClicks }}
-
-
-
-
-
Newsletter analytics
-
Track how many members are opening emails and clicking links
-
-
- {{if this.newsletterTrackingOpen "Close" "Expand"}}
-
+
+
+
+
Newsletter analytics
+
Track how many members are opening emails and clicking links
-
- {{#liquid-if this.newsletterTrackingOpen}}
-
-
-
-
-
Track newsletter opens
-
-
-
-
-
-
-
+
+ {{if this.newsletterTrackingOpen "Close" "Expand"}}
+
+
+
+ {{#liquid-if this.newsletterTrackingOpen}}
+
+
+
+
+
Track newsletter opens
-
-
-
Track newsletter link clicks
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
Track newsletter link clicks
+
+
+
+
+
+
- {{/liquid-if}}
-
-
-
- {{else}}
-
-
-
-
-
Enable newsletter open-rate
-
Track how many members are reading your emails
-
-
-
-
-
-
-
+ {{/liquid-if}}
-
- {{/if}}
+
{{/if}}
diff --git a/ghost/admin/app/routes/posts.js b/ghost/admin/app/routes/posts.js
index aa60e4ad3a..e3f6e92e72 100644
--- a/ghost/admin/app/routes/posts.js
+++ b/ghost/admin/app/routes/posts.js
@@ -83,14 +83,6 @@ export default class PostsRoute extends AuthenticatedRoute {
setupController(controller) {
super.setupController(...arguments);
- if (this.modelName === 'post') {
- if (this.feature.get('emailClicks')) {
- this.templateName = 'posts-clicks';
- } else {
- this.templateName = 'posts';
- }
- }
-
if (!controller._hasLoadedTags) {
this.store.query('tag', {limit: 'all'}).then(() => {
controller._hasLoadedTags = true;
diff --git a/ghost/admin/app/services/feature.js b/ghost/admin/app/services/feature.js
index 36759a6966..cb972fd9d5 100644
--- a/ghost/admin/app/services/feature.js
+++ b/ghost/admin/app/services/feature.js
@@ -63,7 +63,6 @@ export default class FeatureService extends Service {
@feature('compExpiring') compExpiring;
@feature('memberAttribution') memberAttribution;
@feature('emailAlerts') emailAlerts;
- @feature('emailClicks') emailClicks;
@feature('sourceAttribution') sourceAttribution;
@feature('lexicalEditor') lexicalEditor;
diff --git a/ghost/admin/app/templates/pages.hbs b/ghost/admin/app/templates/pages.hbs
index 3e55aedda1..bacb6a0e8a 100644
--- a/ghost/admin/app/templates/pages.hbs
+++ b/ghost/admin/app/templates/pages.hbs
@@ -29,32 +29,11 @@
- {{#unless this.feature.emailClicks}}
- {{#if this.postsInfinityModel}}
-
- {{/if}}
- {{/unless}}
-
{{#each this.postsInfinityModel as |page|}}
- {{#if this.feature.emailClicks}}
-
- {{/if}}
- {{#unless this.feature.emailClicks}}
-
- {{/unless}}
+
{{else}}
diff --git a/ghost/admin/app/templates/posts-clicks.hbs b/ghost/admin/app/templates/posts-clicks.hbs
deleted file mode 100644
index c61dbac540..0000000000
--- a/ghost/admin/app/templates/posts-clicks.hbs
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
- {{#each this.postsInfinityModel as |post|}}
-
- {{else}}
-
-
- {{#if this.showingAll}}
- {{svg-jar "posts-placeholder" class="gh-posts-placeholder"}}
-
Start creating content.
-
- Write a new post
-
- {{else}}
- No posts match the current filter
-
- Show all posts
-
- {{/if}}
-
-
- {{/each}}
-
-
-
-
-
- {{outlet}}
-
diff --git a/ghost/admin/app/templates/posts.hbs b/ghost/admin/app/templates/posts.hbs
index e74dbd6955..f3194860a8 100644
--- a/ghost/admin/app/templates/posts.hbs
+++ b/ghost/admin/app/templates/posts.hbs
@@ -27,52 +27,32 @@
-
-
- {{#if this.postsInfinityModel}}
-
- {{/if}}
-
- {{#each this.postsInfinityModel as |post|}}
-
- {{else}}
-
-
- {{#if this.showingAll}}
- {{svg-jar "posts-placeholder" class="gh-posts-placeholder"}}
-
Start creating content.
-
- Write a new post
-
- {{else}}
- No posts match the current filter
-
- Show all posts
-
- {{/if}}
-
-
- {{/each}}
-
-
+ {{#each this.postsInfinityModel as |post|}}
+
+ {{else}}
+
+
+ {{#if this.showingAll}}
+ {{svg-jar "posts-placeholder" class="gh-posts-placeholder"}}
+
Start creating content.
+
+ Write a new post
+
+ {{else}}
+ No posts match the current filter
+
+ Show all posts
+
+ {{/if}}
+
+
+ {{/each}}
+
{
});
}
- if (labs.isSet('emailClicks')) {
- if (jsonModel.email && jsonModel.count) {
- jsonModel.email.opened_count = Math.min(
- Math.max(
- jsonModel.email.opened_count || 0,
- jsonModel.count.clicks || 0
- ),
- jsonModel.email.email_count
- );
- }
- }
-
- if (!labs.isSet('memberAttribution') && !labs.isSet('emailClicks')) {
- delete jsonModel.count;
+ if (jsonModel.email && jsonModel.count) {
+ jsonModel.email.opened_count = Math.min(
+ Math.max(
+ jsonModel.email.opened_count || 0,
+ jsonModel.count.clicks || 0
+ ),
+ jsonModel.email.email_count
+ );
}
return jsonModel;
diff --git a/ghost/core/core/server/web/api/endpoints/admin/routes.js b/ghost/core/core/server/web/api/endpoints/admin/routes.js
index 34e23ce13b..038d695075 100644
--- a/ghost/core/core/server/web/api/endpoints/admin/routes.js
+++ b/ghost/core/core/server/web/api/endpoints/admin/routes.js
@@ -3,7 +3,6 @@ const api = require('../../../../api').endpoints;
const {http} = require('@tryghost/api-framework');
const apiMw = require('../../middleware');
const mw = require('./middleware');
-const labs = require('../../../../../shared/labs');
const shared = require('../../../shared');
@@ -310,7 +309,7 @@ module.exports = function apiRoutes() {
router.put('/newsletters/verifications/', mw.authAdminApi, http(api.newsletters.verifyPropertyUpdate));
router.put('/newsletters/:id', mw.authAdminApi, http(api.newsletters.edit));
- router.get('/links', labs.enabledMiddleware('emailClicks'), mw.authAdminApi, http(api.links.browse));
+ router.get('/links', mw.authAdminApi, http(api.links.browse));
return router;
};
diff --git a/ghost/core/core/shared/labs.js b/ghost/core/core/shared/labs.js
index 8dea07030f..53317444e5 100644
--- a/ghost/core/core/shared/labs.js
+++ b/ghost/core/core/shared/labs.js
@@ -19,8 +19,7 @@ const GA_FEATURES = [
'freeTrial',
'compExpiring',
'searchHelper',
- 'emailAlerts',
- 'emailClicks'
+ 'emailAlerts'
];
// NOTE: this allowlist is meant to be used to filter out any unexpected
diff --git a/ghost/core/test/e2e-api/admin/__snapshots__/settings.test.js.snap b/ghost/core/test/e2e-api/admin/__snapshots__/settings.test.js.snap
index f9d26768a5..65ba2ea2fa 100644
--- a/ghost/core/test/e2e-api/admin/__snapshots__/settings.test.js.snap
+++ b/ghost/core/test/e2e-api/admin/__snapshots__/settings.test.js.snap
@@ -627,7 +627,7 @@ exports[`Settings API Edit Can edit a setting 2: [headers] 1`] = `
Object {
"access-control-allow-origin": "http://127.0.0.1:2369",
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
- "content-length": "3471",
+ "content-length": "3450",
"content-type": "application/json; charset=utf-8",
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
"vary": "Accept-Version, Origin, Accept-Encoding",
diff --git a/ghost/members-api/lib/repositories/event.js b/ghost/members-api/lib/repositories/event.js
index 7910278e31..3752f25d47 100644
--- a/ghost/members-api/lib/repositories/event.js
+++ b/ghost/members-api/lib/repositories/event.js
@@ -46,13 +46,10 @@ module.exports = class EventRepository {
{type: 'login_event', action: 'getLoginEvents'},
{type: 'payment_event', action: 'getPaymentEvents'},
{type: 'signup_event', action: 'getSignupEvents'},
- {type: 'comment_event', action: 'getCommentEvents'}
+ {type: 'comment_event', action: 'getCommentEvents'},
+ {type: 'click_event', action: 'getClickEvents'}
];
- if (this._labsService.isSet('emailClicks')) {
- pageActions.push({type: 'click_event', action: 'getClickEvents'});
- }
-
if (this._EmailRecipient) {
pageActions.push({type: 'email_delivered_event', action: 'getEmailDeliveredEvents'});
pageActions.push({type: 'email_opened_event', action: 'getEmailOpenedEvents'});