content: remove utm_source=pkggodev
When redirecting from pkg.go.dev to beta.pkg.go.dev, a utm_source is
added to the URL. This is now removed in removeUTMSource.
Change-Id: Iae4f7cfe4c6356672a6a6916d182e9c68e342132
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/310129
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
diff --git a/content/static/js/site.js b/content/static/js/site.js
index bf89eaa..36363d4 100644
--- a/content/static/js/site.js
+++ b/content/static/js/site.js
@@ -3,5 +3,5 @@
* Copyright 2019-2020 The Go Authors. All rights reserved.
* Use of this source code is governed by a BSD-style
* license that can be found in the LICENSE file.
- */(function(){"use strict";const e=document.querySelector(".js-header"),a=document.querySelectorAll(".js-headerMenuButton");a.forEach(n=>{n.addEventListener("click",s=>{s.preventDefault(),e?.classList.toggle("is-active"),n.setAttribute("aria-expanded",`${e?.classList.contains("is-active")??!1}`)})});const r=document.querySelector(".js-scrim");r&&r.hasOwnProperty("addEventListener")&&r.addEventListener("click",n=>{n.preventDefault(),e?.classList.remove("is-active"),a.forEach(s=>{s.setAttribute("aria-expanded",`${e?.classList.contains("is-active")??!1}`)})})})(),function(){window.dataLayer=window.dataLayer||[],window.dataLayer.push({"gtm.start":new Date().getTime(),event:"gtm.js"})}();function removeUTMSource(){const t=new URLSearchParams(window.location.search),e=t.get("utm_source");if(e!=="gopls"&&e!=="godoc")return;const a=new URL(window.location.href);t.delete("utm_source"),a.search=t.toString(),window.history.replaceState(null,"",a.toString())}document.querySelector(".js-gtmID")?.dataset.gtmid&&window.dataLayer?window.dataLayer.push(function(){removeUTMSource()}):removeUTMSource();
+ */(function(){"use strict";const e=document.querySelector(".js-header"),a=document.querySelectorAll(".js-headerMenuButton");a.forEach(n=>{n.addEventListener("click",s=>{s.preventDefault(),e?.classList.toggle("is-active"),n.setAttribute("aria-expanded",`${e?.classList.contains("is-active")??!1}`)})});const r=document.querySelector(".js-scrim");r&&r.hasOwnProperty("addEventListener")&&r.addEventListener("click",n=>{n.preventDefault(),e?.classList.remove("is-active"),a.forEach(s=>{s.setAttribute("aria-expanded",`${e?.classList.contains("is-active")??!1}`)})})})(),function(){window.dataLayer=window.dataLayer||[],window.dataLayer.push({"gtm.start":new Date().getTime(),event:"gtm.js"})}();function removeUTMSource(){const t=new URLSearchParams(window.location.search),e=t.get("utm_source");if(e!=="gopls"&&e!=="godoc"&&e!=="pkggodev")return;const a=new URL(window.location.href);t.delete("utm_source"),a.search=t.toString(),window.history.replaceState(null,"",a.toString())}document.querySelector(".js-gtmID")?.dataset.gtmid&&window.dataLayer?window.dataLayer.push(function(){removeUTMSource()}):removeUTMSource();
//# sourceMappingURL=site.js.map
diff --git a/content/static/js/site.js.map b/content/static/js/site.js.map
index cf94a63..a601c83 100644
--- a/content/static/js/site.js.map
+++ b/content/static/js/site.js.map
@@ -1,7 +1,7 @@
{
"version": 3,
"sources": ["site.ts"],
- "sourcesContent": ["/*!\n * @license\n * Copyright 2019-2020 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * site.ts contains a set of functions that should be invoked for\n * all page views before other scripts are added to the page.\n */\n\n/**\n * A bit of navigation related code for handling dismissible elements.\n */\n(function registerHeaderListeners() {\n 'use strict';\n\n const header = document.querySelector('.js-header');\n const menuButtons = document.querySelectorAll('.js-headerMenuButton');\n menuButtons.forEach(button => {\n button.addEventListener('click', e => {\n e.preventDefault();\n header?.classList.toggle('is-active');\n button.setAttribute('aria-expanded', `${header?.classList.contains('is-active') ?? false}`);\n });\n });\n\n const scrim = document.querySelector('.js-scrim');\n // eslint-disable-next-line no-prototype-builtins\n if (scrim && scrim.hasOwnProperty('addEventListener')) {\n scrim.addEventListener('click', e => {\n e.preventDefault();\n header?.classList.remove('is-active');\n menuButtons.forEach(button => {\n button.setAttribute('aria-expanded', `${header?.classList.contains('is-active') ?? false}`);\n });\n });\n }\n})();\n\ninterface TagManagerEvent {\n event: string;\n 'gtm.start': number;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ninterface Window {\n dataLayer?: (TagManagerEvent | VoidFunction)[];\n}\n\n/**\n * setupGoogleTagManager intializes Google Tag Manager.\n */\n(function setupGoogleTagManager() {\n window.dataLayer = window.dataLayer || [];\n window.dataLayer.push({\n 'gtm.start': new Date().getTime(),\n event: 'gtm.js',\n });\n})();\n\n/**\n * removeUTMSource removes the utm_source GET parameter if present.\n * This is done using JavaScript, so that the utm_source is still\n * captured by Google Analytics.\n */\nfunction removeUTMSource() {\n const urlParams = new URLSearchParams(window.location.search);\n const utmSource = urlParams.get('utm_source');\n if (utmSource !== 'gopls' && utmSource !== 'godoc') {\n return;\n }\n\n /** Strip the utm_source query parameter and replace the URL. **/\n const newURL = new URL(window.location.href);\n urlParams.delete('utm_source');\n newURL.search = urlParams.toString();\n window.history.replaceState(null, '', newURL.toString());\n}\n\nif (document.querySelector<HTMLElement>('.js-gtmID')?.dataset.gtmid && window.dataLayer) {\n window.dataLayer.push(function () {\n removeUTMSource();\n });\n} else {\n removeUTMSource();\n}\n"],
- "mappings": "AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAeA,AAAC,WAAmC,CAClC,aAEA,KAAM,GAAS,SAAS,cAAc,cAChC,EAAc,SAAS,iBAAiB,wBAC9C,EAAY,QAAQ,GAAU,CAC5B,EAAO,iBAAiB,QAAS,GAAK,CACpC,EAAE,iBACF,GAAQ,UAAU,OAAO,aACzB,EAAO,aAAa,gBAAiB,GAAG,GAAQ,UAAU,SAAS,cAAgB,UAIvF,KAAM,GAAQ,SAAS,cAAc,aAErC,AAAI,GAAS,EAAM,eAAe,qBAChC,EAAM,iBAAiB,QAAS,GAAK,CACnC,EAAE,iBACF,GAAQ,UAAU,OAAO,aACzB,EAAY,QAAQ,GAAU,CAC5B,EAAO,aAAa,gBAAiB,GAAG,GAAQ,UAAU,SAAS,cAAgB,cAmB1F,UAAiC,CAChC,OAAO,UAAY,OAAO,WAAa,GACvC,OAAO,UAAU,KAAK,CACpB,YAAa,GAAI,QAAO,UACxB,MAAO,cASX,0BAA2B,CACzB,KAAM,GAAY,GAAI,iBAAgB,OAAO,SAAS,QAChD,EAAY,EAAU,IAAI,cAChC,GAAI,IAAc,SAAW,IAAc,QACzC,OAIF,KAAM,GAAS,GAAI,KAAI,OAAO,SAAS,MACvC,EAAU,OAAO,cACjB,EAAO,OAAS,EAAU,WAC1B,OAAO,QAAQ,aAAa,KAAM,GAAI,EAAO,YAG/C,AAAI,SAAS,cAA2B,cAAc,QAAQ,OAAS,OAAO,UAC5E,OAAO,UAAU,KAAK,UAAY,CAChC,oBAGF",
+ "sourcesContent": ["/*!\n * @license\n * Copyright 2019-2020 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * site.ts contains a set of functions that should be invoked for\n * all page views before other scripts are added to the page.\n */\n\n/**\n * A bit of navigation related code for handling dismissible elements.\n */\n(function registerHeaderListeners() {\n 'use strict';\n\n const header = document.querySelector('.js-header');\n const menuButtons = document.querySelectorAll('.js-headerMenuButton');\n menuButtons.forEach(button => {\n button.addEventListener('click', e => {\n e.preventDefault();\n header?.classList.toggle('is-active');\n button.setAttribute('aria-expanded', `${header?.classList.contains('is-active') ?? false}`);\n });\n });\n\n const scrim = document.querySelector('.js-scrim');\n // eslint-disable-next-line no-prototype-builtins\n if (scrim && scrim.hasOwnProperty('addEventListener')) {\n scrim.addEventListener('click', e => {\n e.preventDefault();\n header?.classList.remove('is-active');\n menuButtons.forEach(button => {\n button.setAttribute('aria-expanded', `${header?.classList.contains('is-active') ?? false}`);\n });\n });\n }\n})();\n\ninterface TagManagerEvent {\n event: string;\n 'gtm.start': number;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ninterface Window {\n dataLayer?: (TagManagerEvent | VoidFunction)[];\n}\n\n/**\n * setupGoogleTagManager intializes Google Tag Manager.\n */\n(function setupGoogleTagManager() {\n window.dataLayer = window.dataLayer || [];\n window.dataLayer.push({\n 'gtm.start': new Date().getTime(),\n event: 'gtm.js',\n });\n})();\n\n/**\n * removeUTMSource removes the utm_source GET parameter if present.\n * This is done using JavaScript, so that the utm_source is still\n * captured by Google Analytics.\n */\nfunction removeUTMSource() {\n const urlParams = new URLSearchParams(window.location.search);\n const utmSource = urlParams.get('utm_source');\n if (utmSource !== 'gopls' && utmSource !== 'godoc' && utmSource !== 'pkggodev') {\n return;\n }\n\n /** Strip the utm_source query parameter and replace the URL. **/\n const newURL = new URL(window.location.href);\n urlParams.delete('utm_source');\n newURL.search = urlParams.toString();\n window.history.replaceState(null, '', newURL.toString());\n}\n\nif (document.querySelector<HTMLElement>('.js-gtmID')?.dataset.gtmid && window.dataLayer) {\n window.dataLayer.push(function () {\n removeUTMSource();\n });\n} else {\n removeUTMSource();\n}\n"],
+ "mappings": "AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAeA,AAAC,WAAmC,CAClC,aAEA,KAAM,GAAS,SAAS,cAAc,cAChC,EAAc,SAAS,iBAAiB,wBAC9C,EAAY,QAAQ,GAAU,CAC5B,EAAO,iBAAiB,QAAS,GAAK,CACpC,EAAE,iBACF,GAAQ,UAAU,OAAO,aACzB,EAAO,aAAa,gBAAiB,GAAG,GAAQ,UAAU,SAAS,cAAgB,UAIvF,KAAM,GAAQ,SAAS,cAAc,aAErC,AAAI,GAAS,EAAM,eAAe,qBAChC,EAAM,iBAAiB,QAAS,GAAK,CACnC,EAAE,iBACF,GAAQ,UAAU,OAAO,aACzB,EAAY,QAAQ,GAAU,CAC5B,EAAO,aAAa,gBAAiB,GAAG,GAAQ,UAAU,SAAS,cAAgB,cAmB1F,UAAiC,CAChC,OAAO,UAAY,OAAO,WAAa,GACvC,OAAO,UAAU,KAAK,CACpB,YAAa,GAAI,QAAO,UACxB,MAAO,cASX,0BAA2B,CACzB,KAAM,GAAY,GAAI,iBAAgB,OAAO,SAAS,QAChD,EAAY,EAAU,IAAI,cAChC,GAAI,IAAc,SAAW,IAAc,SAAW,IAAc,WAClE,OAIF,KAAM,GAAS,GAAI,KAAI,OAAO,SAAS,MACvC,EAAU,OAAO,cACjB,EAAO,OAAS,EAAU,WAC1B,OAAO,QAAQ,aAAa,KAAM,GAAI,EAAO,YAG/C,AAAI,SAAS,cAA2B,cAAc,QAAQ,OAAS,OAAO,UAC5E,OAAO,UAAU,KAAK,UAAY,CAChC,oBAGF",
"names": []
}
diff --git a/content/static/js/site.ts b/content/static/js/site.ts
index de6a112..a1f9d36 100644
--- a/content/static/js/site.ts
+++ b/content/static/js/site.ts
@@ -68,7 +68,7 @@
function removeUTMSource() {
const urlParams = new URLSearchParams(window.location.search);
const utmSource = urlParams.get('utm_source');
- if (utmSource !== 'gopls' && utmSource !== 'godoc') {
+ if (utmSource !== 'gopls' && utmSource !== 'godoc' && utmSource !== 'pkggodev') {
return;
}