Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 0 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,3 @@ SPREADSHEET_ID=[YOU CAN GET THIS ON URL OF YOUR SHEETS] # Available in parameter
NEW_RELIC_LICENSE_KEY=[NEWRELIC LICENSE KEY] # Available in parameter store
NEW_RELIC_APP_NAME="Facelift QA"

# Adobe Analytics
ADOBE_EMBED_URL=https://assets.adobedtm.com/1a9376472d37/8519dfce636d/launch-bf8436264b01-development.min.js
1 change: 0 additions & 1 deletion ENVIRONMENTVARS.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ These environment variables control how certain elements on the page render and
| `COLLECTIONS_API_URL` | string | "https://qa-api-collections.nypl.org" or "https://api-collections.nypl.org" | Base url for Collections API. |
| `COLLECTIONS_API_AUTH_TOKEN` | string | "" | Auth token for Collections API. Set as a Github repo secret, used in Github action workflow (deploy prod). |
| `QA_COLLECTIONS_API_AUTH_TOKEN` | string | "" | Auth token for QA Collections API. Set as a Github repo secret, used in Github action workflow (deploy QA). |
| `ADOBE_EMBED_URL` | string | "" | Url endpoint used for Adobe Analytics event tracking. |
| `GOOGLE_SHEETS_CLIENT_EMAIL` | string | "" | |
| `GOOGLE_SHEETS_PRIVATE_KEY` | string | "" | |
| `SPREADSHEET_ID` | string | "" | |
Expand Down
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,13 +238,6 @@ Example:
```
const appConfig = {
environment: process.env.APP_ENV || "development",
adobeEmbedUrl: {
development:
"https://assets.adobedtm.com/1a9376472d37/8519dfce636d/launch-bf8436264b01-development.min.js",
qa: "https://assets.adobedtm.com/1a9376472d37/8519dfce636d/launch-bf8436264b01-development.min.js",
production:
"https://assets.adobedtm.com/1a9376472d37/8519dfce636d/launch-672b7e7f98ee.min.js",
},
};
```

Expand Down
6 changes: 1 addition & 5 deletions app/collections/[uuid]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { Metadata } from "next";
import PageLayout from "../../src/components/pageLayout/pageLayout";
import { createAdobeAnalyticsPageName, imageURL } from "@/src/utils/utils";
import { imageURL } from "@/src/utils/utils";
import CollectionPage from "@/src/components/pages/collectionPage/collectionPage";
import { CollectionsApi } from "@/src/utils/apiClients/apiClients";
import { AvailableFilterOption } from "@/src/types/AvailableFilterType";
Expand Down Expand Up @@ -84,10 +84,6 @@ export default async function Collection({
url: `/collections/${params.uuid}`,
},
]}
adobeAnalyticsPageName={createAdobeAnalyticsPageName(
"collections",
params.uuid
)}
ga4Data={{
collection: collectionData.title,
division: collectionData.divisionTitle,
Expand Down
2 changes: 0 additions & 2 deletions app/collections/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { CollectionsPage } from "../src/components/pages/collectionsPage/collect
import { CollectionsApi } from "@/src/utils/apiClients/apiClients";
import { redirect } from "next/navigation";
import PageLayout from "@/src/components/pageLayout/pageLayout";
import { createAdobeAnalyticsPageName } from "@/src/utils/utils";
import { revalidatePath } from "next/cache";
import { CollectionSearchParamsType } from "./[uuid]/page";

Expand Down Expand Up @@ -44,7 +43,6 @@ export default async function Collections({ searchParams }: CollectionsProps) {
{ text: "Home", url: "/" },
{ text: "Collections", url: "/collections" },
]}
adobeAnalyticsPageName={createAdobeAnalyticsPageName("all-collections")}
>
<CollectionsPage collectionsSearchParams={searchParams} data={data} />
</PageLayout>
Expand Down
8 changes: 1 addition & 7 deletions app/error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { useEffect } from "react";

import PageLayout from "./src/components/pageLayout/pageLayout";
import ErrorPage from "./src/components/pages/errorPage/errorPage";
import { createAdobeAnalyticsPageName } from "./src/utils/utils";

export default function Error({
error,
Expand All @@ -21,12 +20,7 @@ export default function Error({
}, [error]);

return (
<PageLayout
activePage="serverError"
adobeAnalyticsPageName={createAdobeAnalyticsPageName(
"internal-server-error"
)}
>
<PageLayout activePage="serverError">
<ErrorPage />
</PageLayout>
);
Expand Down
3 changes: 1 addition & 2 deletions app/items/[uuid]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react";
import { Metadata } from "next";
import { headers } from "next/headers";
import PageLayout from "../../src/components/pageLayout/pageLayout";
import { imageURL, createAdobeAnalyticsPageName } from "../../src/utils/utils";
import { imageURL } from "../../src/utils/utils";
import { ItemModel } from "../../src/models/item";
import { ItemPage } from "@/src/components/pages/itemPage/itemPage";
import { revalidatePath } from "next/cache";
Expand Down Expand Up @@ -119,7 +119,6 @@ export default async function ItemViewer({ params, searchParams }: ItemProps) {
<PageLayout
activePage="item"
breadcrumbs={breadcrumbData}
adobeAnalyticsPageName={createAdobeAnalyticsPageName("items", item.title)}
ga4Data={{
division: breadcrumbData[1]?.text,
collection: breadcrumbData[2]?.text,
Expand Down
2 changes: 0 additions & 2 deletions app/search/index/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from "react";
import PageLayout from "../../src/components/pageLayout/pageLayout";
import { createAdobeAnalyticsPageName } from "@/src/utils/utils";
import { CollectionsApi } from "@/src/utils/apiClients/apiClients";
import { Metadata } from "next";
import SearchPage from "@/src/components/pages/searchPage/searchPage";
Expand Down Expand Up @@ -51,7 +50,6 @@ export default async function Search({ searchParams }: SearchProps) {
{ text: "Home", url: "/" },
{ text: "Keyword Search", url: "/search/index" },
]}
adobeAnalyticsPageName={createAdobeAnalyticsPageName(pageName, "")}
searchParams={updatedSearchParams}
>
<SearchPage searchResults={searchResults} />
Expand Down
20 changes: 1 addition & 19 deletions app/src/components/pageLayout/pageLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import { type PropsWithChildren } from "react";
import Header from "../header/header";
import Script from "next/script";
import { BreadcrumbsDataProps } from "@nypl/design-system-react-components/dist/src/components/Breadcrumbs/Breadcrumbs";
import { ADOBE_EMBED_URL } from "../../config/constants";
import { trackVirtualPageView } from "../../utils/utils";
import { FeedbackProvider } from "@/src/context/FeedbackProvider";
import { SearchParamsType } from "@/search/index/page";
import { SearchProvider } from "@/src/context/SearchProvider";
Expand All @@ -22,7 +20,6 @@ import { trackGa4PageView } from "@/src/utils/ga4Utils";
interface PageLayoutProps {
activePage: string;
breadcrumbs?: BreadcrumbsDataProps[];
adobeAnalyticsPageName?: string;
ga4Data?: {
collection?: string;
division?: string;
Expand All @@ -37,13 +34,11 @@ const PageLayout = ({
children,
activePage,
breadcrumbs,
adobeAnalyticsPageName,
ga4Data,
searchParams,
}: PropsWithChildren<PageLayoutProps>) => {
// Track page view events to Adobe Analytics
// Track page view events to Google Analytics
useEffect(() => {
trackVirtualPageView(adobeAnalyticsPageName);
if (ga4Data) {
trackGa4PageView(
ga4Data.division,
Expand All @@ -59,19 +54,6 @@ const PageLayout = ({

return (
<>
{/* <!-- Adobe Analytics --> */}
<Script async src={ADOBE_EMBED_URL} />
<Script id="adobeDataLayerDefinition">
{`
// First define the global variable for the entire data layer array
window.adobeDataLayer = window.adobeDataLayer || [];
// Then push in the variables required in the Initial Data Layer Definition
window.adobeDataLayer.push({
disable_page_view: true
});
`}
</Script>
{/* <!-- / Adobe Analytics --> */}
<DSProvider>
<SearchProvider searchParams={searchParams}>
<FeedbackProvider>
Expand Down
6 changes: 1 addition & 5 deletions app/src/components/pages/aboutPage/aboutPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import { Box } from "@nypl/design-system-react-components";
import aboutPageElements from "../../aboutPageElements/aboutPageElements";
import PageLayout from "../../pageLayout/pageLayout";
import { createAdobeAnalyticsPageName } from "@/src/utils/utils";

export default function AboutPage() {
function createSection(
Expand All @@ -19,10 +18,7 @@ export default function AboutPage() {
}

return (
<PageLayout
activePage="about"
adobeAnalyticsPageName={createAdobeAnalyticsPageName("about")}
>
<PageLayout activePage="about">
<Box
id="aboutPageContent"
sx={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
displayResults,
slugToString,
totalNumPages,
createAdobeAnalyticsPageName,
} from "../../../utils/utils";
import { CardsGrid } from "../../grids/cardsGrid";
import React, { useEffect, useRef, useState } from "react";
Expand Down Expand Up @@ -68,10 +67,6 @@ export default function CollectionLanePage({ data }: any) {
{ text: "Collections", url: "/collections" },
{ text: `${title}`, url: `/collections/lane/${slug}` },
]}
adobeAnalyticsPageName={createAdobeAnalyticsPageName(
"collections|lane",
slug
)}
>
<Box
sx={{
Expand Down
7 changes: 1 addition & 6 deletions app/src/components/pages/divisionPage/divisionPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ import React, { useEffect, useState, useRef } from "react";
import PageLayout from "../../pageLayout/pageLayout";
import { headerBreakpoints } from "../../../utils/breakpoints";
import { CardsGrid } from "../../grids/cardsGrid";
import {
totalNumPages,
createAdobeAnalyticsPageName,
displayResults,
} from "../../../utils/utils";
import { totalNumPages, displayResults } from "../../../utils/utils";
import { Lane as DCLane } from "../../lane/lane";
import LaneLoading from "../../lane/laneLoading";
import { CARDS_PER_PAGE } from "@/src/config/constants";
Expand Down Expand Up @@ -67,7 +63,6 @@ export default function DivisionPage({ data }: any) {
{ text: "Divisions", url: "/divisions" },
{ text: `${data.name}`, url: `/divisions/${data.slug}` },
]}
adobeAnalyticsPageName={createAdobeAnalyticsPageName("divisions", slug)}
ga4Data={{ division: data.name }}
>
<Box
Expand Down
2 changes: 0 additions & 2 deletions app/src/components/pages/divisionsPage/divisionsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import React, { useEffect, useState } from "react";
import { Lane as DCLane } from "../../lane/lane";
import LaneLoading from "../../lane/laneLoading";
import LaneDataType from "@/src/types/LaneDataType";
import { createAdobeAnalyticsPageName } from "@/src/utils/utils";

interface DivisionsProps {
summary: string;
Expand All @@ -31,7 +30,6 @@ export default function DivisionsPage({ summary, divisions }: DivisionsProps) {
{ text: "Home", url: "/" },
{ text: "Divisions", url: "/divisions" },
]}
adobeAnalyticsPageName={createAdobeAnalyticsPageName("divisions")}
>
{divisions && divisions.length > 0 ? (
<>
Expand Down
6 changes: 1 addition & 5 deletions app/src/components/pages/homePage/homePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,9 @@ import ExploreFurther from "../../exploreFurther/exploreFurther";
import CampaignHero from "../../featuredItem/campaignHero";
import HomePageMainContent from "../../homePageMainContent/homePageMainContent";
import PageLayout from "../../pageLayout/pageLayout";
import { createAdobeAnalyticsPageName } from "@/src/utils/utils";
export default function HomePage({ data }) {
return (
<PageLayout
activePage="home"
adobeAnalyticsPageName={createAdobeAnalyticsPageName("home")}
>
<PageLayout activePage="home">
<Template>
<TemplateBreakout>
<CampaignHero featuredItemData={data.featuredItemData} />
Expand Down
8 changes: 1 addition & 7 deletions app/src/components/pages/notFoundPage/notFoundPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
} from "@nypl/design-system-react-components";
import PageLayout from "../../pageLayout/pageLayout";
import Image from "next/image";
import { createAdobeAnalyticsPageName } from "@/src/utils/utils";
import { useEffect } from "react";
import { usePathname } from "next/navigation";

Expand All @@ -25,12 +24,7 @@ export default function NotFoundPage() {
}, [pathname]);

return (
<PageLayout
activePage="notFound"
adobeAnalyticsPageName={createAdobeAnalyticsPageName(
"page-not-found-error"
)}
>
<PageLayout activePage="notFound">
<Flex
flexDir="column"
marginTop="xxl"
Expand Down
6 changes: 0 additions & 6 deletions app/src/config/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ import appConfig from "../../../appConfig";
export const BASE_URL = "/";
export const SITE_NAME = "NYPL Digital Collections";

// String used to namespace Digital Collection events in Adobe Analytics
export const ADOBE_ANALYTICS_SITE_SECTION = "Digital Collections";
export const ADOBE_ANALYTICS_DC_PREFIX = "dc|";
export const ADOBE_EMBED_URL =
appConfig.adobeEmbedUrl[appConfig.environment as ENV_KEY];

export const TRUNCATED_CARD_LENGTH = 80;
export const TRUNCATED_SEARCH_CARD_LENGTH = 140;

Expand Down
Loading