multi: fix analytics for on-prem

This commit fixes some more analytics calls happening in the on-prem
frontend.
This commit is contained in:
Gianluca Zuccarelli 2025-07-01 16:03:13 +01:00 committed by Klara Simickova
parent 2ce62d4ef0
commit 2f765a1d4b
3 changed files with 38 additions and 21 deletions

View file

@ -57,11 +57,13 @@ export const BuildImagesButton = ({ children }: BuildImagesButtonPropTypes) => {
),
},
});
analytics.track(`${AMPLITUDE_MODULE_NAME} - Image Requested`, {
module: AMPLITUDE_MODULE_NAME,
trigger: 'synchronize images',
account_id: userData?.identity.internal?.account_id || 'Not found',
});
if (!process.env.IS_ON_PREMISE) {
analytics.track(`${AMPLITUDE_MODULE_NAME} - Image Requested`, {
module: AMPLITUDE_MODULE_NAME,
trigger: 'synchronize images',
account_id: userData?.identity.internal?.account_id || 'Not found',
});
}
}
};
const [isOpen, setIsOpen] = useState(false);

View file

@ -163,13 +163,15 @@ export const AwsDetails = ({ compose }: AwsDetailsPropTypes) => {
clickTip="Copied"
variant="inline-compact"
onClick={() => {
analytics.track(`${AMPLITUDE_MODULE_NAME} - Copy UUID`, {
module: AMPLITUDE_MODULE_NAME,
link_name: compose.id,
current_path: window.location.pathname,
account_id:
userData?.identity.internal?.account_id || 'Not found',
});
if (!process.env.IS_ON_PREMISE) {
analytics.track(`${AMPLITUDE_MODULE_NAME} - Copy UUID`, {
module: AMPLITUDE_MODULE_NAME,
link_name: compose.id,
current_path: window.location.pathname,
account_id:
userData?.identity.internal?.account_id || 'Not found',
});
}
}}
>
{compose.id}
@ -203,16 +205,18 @@ export const AwsDetails = ({ compose }: AwsDetailsPropTypes) => {
// https://docs.aws.amazon.com/signin/latest/userguide/sign-in-urls-defined.html
href={`https://${options.share_with_accounts[0]}.signin.aws.amazon.com/console/`}
onClick={() => {
analytics.track(`${AMPLITUDE_MODULE_NAME} - Link Clicked`, {
module: AMPLITUDE_MODULE_NAME,
if (!process.env.IS_ON_PREMISE) {
analytics.track(`${AMPLITUDE_MODULE_NAME} - Link Clicked`, {
module: AMPLITUDE_MODULE_NAME,
link_name: options.share_with_accounts
? options.share_with_accounts[0]
: '',
current_path: window.location.pathname,
account_id:
userData?.identity.internal?.account_id || 'Not found',
});
link_name: options.share_with_accounts
? options.share_with_accounts[0]
: '',
current_path: window.location.pathname,
account_id:
userData?.identity.internal?.account_id || 'Not found',
});
}
}}
>
{options.share_with_accounts[0]}