Skip to content
Open
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
12 changes: 0 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,20 +222,8 @@ Redirects are configured in `netlify.toml`

The site uses [iubenda](https://www.iubenda.com/) to manage tracking consent.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With cookies removed we can remove this line and all of the iubenda code in the footer

<div class="subfooter">

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Apply this suggestion.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed iubenda line from README.md and all iubenda code from footer.html including:

  • Privacy Policy and Cookie Policy links
  • Your Privacy Choices link with CCPA icon
  • Notice at Collection link
  • iubenda.js script loader

Commit: 8e69c47


Tracking scripts are loaded via [Google Tag Manager](https://tagmanager.google.com/#/container/accounts/6068072463/containers/116206463/workspaces/9)

Analytics are recorded in [Google Analytics](https://analytics.google.com/analytics/web/#/p373834203/reports/home) and [Heap](https://heapanalytics.com/app/env/4204607514/dashboard/Testcontainers-Overview-278374)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Analytics will no longer be recorded. If we want to keep this a link to historical data we can update this line to explain that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Apply this suggestion.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the analytics line in README.md to clarify that it links to historical data only, with a note that analytics are no longer being recorded.

Commit: 5a8b6f3


### TCD install attribution

During Testcontainers Desktop client authorization users are redirected to `https://testcontainers.com/desktop/authorized/`.

This page sends an `attribution` event to [Mixpanel](https://eu.mixpanel.com/project/2717988/view/3254192/app/events#pYPErQ1bEeiU) that links any attribution information in the users cookies (utms, referrer etc) to the client install ID.

The code for this page is found in `/layouts/authorized/baseof.html`.

The script that saves that attribution data to the users cookies is in the Google Tag Manager container.

## Additional Notes

### Testcontainers Slack channel link
Expand Down
92 changes: 0 additions & 92 deletions assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,85 +97,6 @@ function setQueryParam(param, value) {
history.replaceState(history.state, "", url.href);
}

// Handle UTMs
const utms = [];

const referrerCookie = getCookie("__gtm_referrer");
if (referrerCookie) {
utms.push({
key: "original_referrer",
value: referrerCookie
});
} else if (document.referrer) {
utms.push({
key: "original_referrer",
value: document.referrer
});
}

const campaignCookie = getCookie("__gtm_campaign_url");
if (campaignCookie) {
const url = new URL(campaignCookie);
const params = new URLSearchParams(url.search);
const cookieUtms = parseUtms(params);
utms.push(...cookieUtms);
} else {
const queryParams = parseUtms(new URLSearchParams(window.location.search));
utms.push(...queryParams);
}

function parseUtms(params) {
const utms = [];
const utmKeys = [
"utm_campaign",
"utm_source",
"utm_medium",
"utm_term",
"utm_content"
];
utmKeys.forEach((key) => {
const value = params.get(key) || false;
if (value) utms.push({
key: key,
value: value
});
});
return utms;
}

function getCookie(key) {
var cookies = document.cookie.split(";");
for (var i = 0; i < cookies.length; i++) {
var cookie = cookies[i].split("=");
if (key == cookie[0].trim()) {
return decodeURIComponent(cookie[1]);
}
}
return null;
}

signupLinks = document.querySelectorAll("a[href*='app.testcontainers.cloud/signup']");
signupLinks.forEach(link => {
const url = new URL(link.href);
const query = new URLSearchParams(url.search);
utms.forEach(utm => {
query.set(utm.key, utm.value);
});
const queryString = (query.toString() != "") ? "?" + query.toString() : "";
url.search = queryString;
link.href = url.toString();
});
signupForms = document.querySelectorAll(".tcc-signup-form");
signupForms.forEach(form => {
utms.forEach(utm => {
const field = document.createElement("input");
field.setAttribute("type", "hidden");
field.setAttribute("name", utm.key);
field.setAttribute("value", utm.value);
form.appendChild(field);
});
});

hljs.addPlugin({
"after:highlightElement": ({ el, result, text }) => {
let button = Object.assign(document.createElement("button"), {
Expand Down Expand Up @@ -231,24 +152,11 @@ async function hashText(text) {
function dismissAnnouncementBanner() {
announcementBanner.classList.remove("not-dismissed");
announcementBanner.classList.add("dismissed");
hashText(announcementBanner.innerHTML)
.then((hash) => {
localStorage.setItem("dismissedAnnouncement", hash);
});
}
const announcementBanner = document.getElementById("announcement-banner");
if (announcementBanner) {
const announcementBannerButton = document.getElementById("announcement-banner-button");
announcementBannerButton.addEventListener('click', dismissAnnouncementBanner);
hashText(announcementBanner.innerHTML)
.then((hash) => {
if (localStorage.getItem("dismissedAnnouncement") && localStorage.getItem("dismissedAnnouncement") === hash) {
announcementBanner.classList.remove("not-dismissed");
announcementBanner.classList.add("dismissed");
} else {
announcementBanner.classList.add("not-dismissed");
}
})
}

function setActiveDownloadBannerSection(id) {
Expand Down
11 changes: 0 additions & 11 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@
<!DOCTYPE html>
<html lang="en-us">
<head>
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://tag-manager.testcontainers.com/';f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-5LGVXVD');</script>
<!-- End Google Tag Manager -->
{{- partial "head.html" . -}}
{{- block "pageScripts" . }}{{- end }}
</head>
Expand All @@ -29,9 +22,5 @@
{{- partial "footer.html" . -}}
{{- partial "svgs/sprite.html" -}}
{{- block "footerScripts" . }}{{- end }}
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-5LGVXVD"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
</body>
</html>
74 changes: 2 additions & 72 deletions layouts/authorized/baseof.html
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With all of the client side reason for this page removed, we could add it to the redirects in netlify.toml. We may also wan't to update the TCC code to not redirect users to this page anymore.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Apply this suggestion.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added redirect in netlify.toml to redirect /desktop/authorized/ directly to https://app.testcontainers.cloud/api/auth/login with a 302 status code. This eliminates the need for the client-side redirect page.

Commit: 5a8b6f3

Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
{{- $mixpanelToken := "0897a75fb0160b842eb1218bad4fe322" -}}
{{- if hugo.IsProduction -}}
{{- $mixpanelToken = "77dfea682129533729f4dbcd188952e5" -}}
{{- end -}}
<!DOCTYPE html>
<html>
<head>
<meta name="robots" content="noindex, nofollow">
<script type="text/javascript">
const MIXPANEL_CUSTOM_LIB_URL = "https://telemetry.svc.testcontainers.cloud/lib.min.js";
function redirectToDashboard() {
const redirectUrl = new URL("https://app.testcontainers.cloud/api/auth/login");
const account = new URLSearchParams(window.location.search).get("account");
Expand All @@ -16,75 +11,10 @@
}
window.location.assign(redirectUrl);
}
(function(f,b){if(!b.__SV){var e,g,i,h;window.mixpanel=b;b._i=[];b.init=function(e,f,c){function g(a,d){var b=d.split(".");2==b.length&&(a=a[b[0]],d=b[1]);a[d]=function(){a.push([d].concat(Array.prototype.slice.call(arguments,0)))}}var a=b;"undefined"!==typeof c?a=b[c]=[]:c="mixpanel";a.people=a.people||[];a.toString=function(a){var d="mixpanel";"mixpanel"!==c&&(d+="."+c);a||(d+=" (stub)");return d};a.people.toString=function(){return a.toString(1)+".people (stub)"};i="disable time_event track track_pageview track_links track_forms track_with_groups add_group set_group remove_group register register_once alias unregister identify name_tag set_config reset opt_in_tracking opt_out_tracking has_opted_in_tracking has_opted_out_tracking clear_opt_in_out_tracking start_batch_senders people.set people.set_once people.unset people.increment people.append people.union people.track_charge people.clear_charges people.delete_user people.remove".split(" ");
for(h=0;h<i.length;h++)g(a,i[h]);var j="set set_once union unset remove delete".split(" ");a.get_group=function(){function b(c){d[c]=function(){call2_args=arguments;call2=[c].concat(Array.prototype.slice.call(call2_args,0));a.push([e,call2])}}for(var d={},e=["get_group"].concat(Array.prototype.slice.call(arguments,0)),c=0;c<j.length;c++)b(j[c]);return d};b._i.push([e,f,c])};b.__SV=1.2;e=f.createElement("script");e.type="text/javascript";e.setAttribute('onerror', 'redirectToDashboard();');e.async=!0;e.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:"file:"===f.location.protocol&&"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\/\//)?"https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js":"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";g=f.getElementsByTagName("script")[0];g.parentNode.insertBefore(e,g)}})(document,window.mixpanel||[]);
// Redirect immediately
redirectToDashboard();
</script>
</head>
<body>
<script>
const searchParams = new URLSearchParams(window.location.search);
if(searchParams.has('id')){
const utms = {};

const referrerCookie = getCookie("__gtm_referrer");
if (referrerCookie) {
utms.original_referrer = referrerCookie;
}

const campaignCookie = getCookie("__gtm_campaign_url");
if (campaignCookie) {
const url = new URL(campaignCookie);
utms.utm_landing_page = `${url.hostname}${url.pathname}`;
const params = new URLSearchParams(url.search);
const keys = [
"utm_campaign",
"utm_source",
"utm_medium",
"utm_term",
"utm_content"
]
keys.forEach(key => {
const value = params.get(key) || false;
if (value) {
utms[key] = value;
}
});
}

const firstTouch = getCookie("__gtm_first_touch");

function getCookie(key) {
var cookies = document.cookie.split(";");
for(var i = 0; i < cookies.length; i++) {
var cookie = cookies[i].split("=");
if(key == cookie[0].trim()) {
return decodeURIComponent(cookie[1]);
}
}
return null;
}

mixpanel.init("{{- $mixpanelToken -}}", {
track_pageview: false,
api_host: "https://telemetry.svc.testcontainers.cloud",
disable_persistence: true
});
mixpanel.track(
"attribution",
{
installation_id: searchParams.get("id"),
first_touch: firstTouch,
raw_utms: utms,
...utms
},
{
send_immediately: true
},
function() {
redirectToDashboard();
}
);
}
</script>
</body>
</html>