From 9d27014aff738adfca1699eeffe45302f3dfc98e Mon Sep 17 00:00:00 2001 From: Simon Backx Date: Thu, 6 Oct 2022 20:16:02 +0200 Subject: [PATCH] Reverted change in post email serializer refs https://github.com/TryGhost/Ghost/commit/d4540012dc999a20dc3522ccc7b4bec16ad8a362 This was committed by accident --- .../core/server/services/mega/post-email-serializer.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/ghost/core/core/server/services/mega/post-email-serializer.js b/ghost/core/core/server/services/mega/post-email-serializer.js index dbe031d636..87d1d3ad52 100644 --- a/ghost/core/core/server/services/mega/post-email-serializer.js +++ b/ghost/core/core/server/services/mega/post-email-serializer.js @@ -358,17 +358,13 @@ const PostEmailSerializer = { // Now replace the links in the HTML version if (!options.isBrowserPreview && !options.isTestEmail && settingsCache.get('email_track_clicks')) { result.html = await linkReplacer.replace(result.html, async (url) => { + // Add newsletter source attribution + url = memberAttribution.service.addEmailSourceAttributionTracking(url, newsletter); const isSite = urlUtils.isSiteUrl(url); if (isSite) { - url = memberAttribution.service.addEmailSourceAttributionTracking(url, newsletter); - // Only add post attribution to our own site (because external sites could/should not process this information) url = memberAttribution.service.addPostAttributionTracking(url, post); - } else { - // For external sites, add ref to the site URL instead of newsletter - const siteUrl = new URL(urlUtils.urlFor('home', true)); - url.searchParams.append('ref', siteUrl.hostname); } // Add link click tracking