diff --git a/services/web/app/views/_mixins/ciam_mixins.pug b/services/web/app/views/_mixins/ciam_mixins.pug index 84a226a8a9..8fba22064d 100644 --- a/services/web/app/views/_mixins/ciam_mixins.pug +++ b/services/web/app/views/_mixins/ciam_mixins.pug @@ -17,6 +17,14 @@ mixin ciamCardFooter(short) href='https://www.digital-science.com/' target='_blank' rel='noopener noreferrer' + event-tracking-mb='true' + event-tracking='unified-access-footer-click' + event-tracking-trigger='click' + event-segmentation={ + product: 'overleaf', + item: 'logo', + destinationUrl: 'https://www.digital-science.com/', + } ) img( src=buildImgPath('digital-science/digital-science.svg') @@ -26,7 +34,42 @@ mixin ciamCardFooter(short) if short | !{translate('overleaf_is_a_ds_product')} else - | !{translate('advancing_research_with', null, [{ name: 'a', attrs: { href: 'https://www.overleaf.com/', target: '_blank', rel: 'noopener noreferrer' }}, { name: 'a', attrs: { href: 'https://www.papersapp.com/', target: '_blank', rel: 'noopener noreferrer' }}])} + - + const linkArgs = [ + { + name: 'a', + attrs: { + href: 'https://www.overleaf.com/', + target: '_blank', + rel: 'noopener noreferrer', + 'event-tracking-mb': 'true', + 'event-tracking': 'unified-access-footer-click', + 'event-tracking-trigger': 'click', + 'event-segmentation': { + product: 'overleaf', + item: 'overleaf', + destinationUrl: 'https://www.overleaf.com/' + } + } + }, + { + name: 'a', + attrs: { + href: 'https://www.papersapp.com/', + target: '_blank', + rel: 'noopener noreferrer', + 'event-tracking-mb': 'true', + 'event-tracking': 'unified-access-footer-click', + 'event-tracking-trigger': 'click', + 'event-segmentation': { + product: 'overleaf', + item: 'papers', + destinationUrl: 'https://www.papersapp.com/' + } + } + } + ] + | !{translate('advancing_research_with', null, linkArgs)} mixin ciamTermsOfServiceAgreement p diff --git a/services/web/frontend/js/shared/components/layouts/ciam-layout.tsx b/services/web/frontend/js/shared/components/layouts/ciam-layout.tsx index a4b637eba3..724b503015 100644 --- a/services/web/frontend/js/shared/components/layouts/ciam-layout.tsx +++ b/services/web/frontend/js/shared/components/layouts/ciam-layout.tsx @@ -1,5 +1,6 @@ import React, { FC, ReactNode } from 'react' import { Trans } from 'react-i18next' +import * as eventTracking from '@/infrastructure/event-tracking' import dsLogo from '@/shared/svgs/digital-science.svg' type Props = { children: ReactNode } @@ -22,6 +23,13 @@ const CiamLayout: FC = ({ children }: Props) => ( target="_blank" rel="noopener noreferrer" className="ciam-image-link" + onClick={() => + eventTracking.sendMB('unified-access-footer-click', { + product: 'overleaf', + item: 'logo', + destinationUrl: 'https://www.digital-science.com/', + }) + } > Digital Science — home @@ -35,12 +43,26 @@ const CiamLayout: FC = ({ children }: Props) => ( href="https://www.overleaf.com/" target="_blank" rel="noopener noreferrer" + onClick={() => + eventTracking.sendMB('unified-access-footer-click', { + product: 'overleaf', + item: 'overleaf', + destinationUrl: 'https://www.overleaf.com/', + }) + } />, // eslint-disable-next-line jsx-a11y/anchor-has-content,react/jsx-key + eventTracking.sendMB('unified-access-footer-click', { + product: 'overleaf', + item: 'papers', + destinationUrl: 'https://www.papersapp.com/', + }) + } />, ]} />