Skip to content

Commit

Permalink
Merge pull request #45 from DTS-STN/analytics-code
Browse files Browse the repository at this point in the history
Add code for Adobe Analytics
  • Loading branch information
will0684 committed Feb 13, 2024
2 parents 86ee197 + 9d8836b commit 80eea5d
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 1 deletion.
3 changes: 3 additions & 0 deletions astro-frontend/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ module.exports = {
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
root: true,
globals: {
"_satellite" : true,
},
// ...
overrides: [
{
Expand Down
3 changes: 3 additions & 0 deletions astro-frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ WORKDIR /app

COPY . .

ARG ADOBE_ANALYTICS_URL=""

RUN npm install
RUN npm run build

ENV ADOBE_ANALYTICS_URL=$ADOBE_ANALYTICS_URL
ENV HOST=0.0.0.0
ENV PORT=4321
EXPOSE 4321
Expand Down
4 changes: 3 additions & 1 deletion astro-frontend/azure-pipelines/dev-build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ stages:
$(image.tag)
latest
stable
arguments: '--pull'
arguments: |
--pull
--build-arg ADOBE_ANALYTICS_URL=$(ADOBE_ANALYTICS_URL)
- task: Docker@2
inputs:
Expand Down
30 changes: 30 additions & 0 deletions astro-frontend/src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,47 @@ const { lang } = Astro.params;
<!doctype html>
<html lang={lang}>
<head>
{
process.env.ADOBE_ANALYTICS_URL ? (
<script src={process.env.ADOBE_ANALYTICS_URL} />
) : (
""
)
}
<meta charset="UTF-8" />
<meta name="description" content="benefit navgiator newsfeed" />
<meta name="viewport" content="width=device-width" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<meta name="generator" content={Astro.generator} />
<!-- Adobe Analytics Required Metadata Properties-->
<meta name="dcterms.title" content={title} />
<meta
name="dcterms.language"
content={lang === "en" ? "eng" : "fra"}
title="ISO639-2/T"
/>
<meta
name="dcterms.creator"
content={lang === "en"
? "Employment and Social Development Canada"
: "Emploi et Développement social Canada"}
/>
<meta name="dcterms.accessRights" content="2" />
<meta name="dcterms.service" content="ESDC-EDSC_Benefits_Newsfeed_Fil_d’actualite" />

<title>{title}</title>
<ViewTransitions />
</head>
<body class="flex flex-col min-h-[100dvh]">
<Header lang={lang} />
<slot />
<Footer lang={lang} />
{
process.env.ADOBE_ANALYTICS_URL ? (
<script type="text/javascript">_satellite.pageBottom()</script>
) : (
""
)
}
</body>
</html>

0 comments on commit 80eea5d

Please sign in to comment.