Skip to content

Commit

Permalink
feat: remove conversion setup (#1237)
Browse files Browse the repository at this point in the history
Conversion rules are now much stricter enforced than what is specified
in the docs:

https://ads-help.brave.com/campaign-performance/reporting/#conversion-reporting-in-brave-ads-manager

We should remove conversion setup until we can adequately explain how to
setup a proper URL
  • Loading branch information
IanKrieger committed Jun 25, 2024
1 parent f8b8b6d commit 738ece9
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 237 deletions.
64 changes: 0 additions & 64 deletions src/components/Conversion/ConversionDisplay.tsx

This file was deleted.

59 changes: 0 additions & 59 deletions src/components/Conversion/ConversionFields.tsx

This file was deleted.

5 changes: 0 additions & 5 deletions src/form/fragmentUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@ function createAdSetFromFragment(
})),
price: data.price ?? "6",
billingType: data.billingType ?? "cpm",
conversions: (data.conversions ?? []).map((c) => ({
observationWindow: c.observationWindow,
type: c.type,
urlPattern: c.urlPattern,
})),
// eslint-disable-next-line lingui/no-unlocalized-strings
name: `${data.name ? data.name : data.id.split("-")[0]} - Copy`,
oses: (data.oses ?? []).map((o) => ({ name: o.name, code: o.code })),
Expand Down
2 changes: 0 additions & 2 deletions src/user/library/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ describe("new form tests", () => {
};

const adSetForm: AdSetForm = {
conversions: [],
creatives: [creative, creative2],
isNotTargeting: false,
name: "",
Expand Down Expand Up @@ -253,7 +252,6 @@ describe("new form tests", () => {
},
],
"billingType": "cpm",
"conversions": [],
"name": "",
"oses": [
{
Expand Down
14 changes: 0 additions & 14 deletions src/user/library/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
AdSetForm,
Billing,
CampaignForm,
Conversion,
Creative,
initialCreative,
Segment,
Expand Down Expand Up @@ -40,7 +39,6 @@ export function transformNewForm(
budget: form.budget,
adSets: form.adSets.map((a) => ({
...transformAdSet(a, form),
conversions: transformConversion(a.conversions),
ads: a.creatives
.filter(
(c) =>
Expand All @@ -62,18 +60,6 @@ export const transformPrice = (
: price.toString();
};

function transformConversion(conv: Conversion[]) {
if (conv.length <= 0) {
return [];
}

return conv.map((c) => ({
observationWindow: c.observationWindow * 1.0,
urlPattern: c.urlPattern,
type: c.type,
}));
}

export function editCampaignValues(
campaign: CampaignFragment,
advertiserId: string,
Expand Down
14 changes: 0 additions & 14 deletions src/user/views/adsManager/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,10 @@ export type AdSetForm = {
name: string;
segments: Segment[];
oses: OS[];
conversions: Conversion[];
creatives: Creative[];
isNotTargeting: boolean;
};

export type Conversion = {
type: string;
observationWindow: number;
urlPattern: string;
};

export type Segment = {
code: string;
name: string;
Expand All @@ -73,12 +66,6 @@ export type Creative = CreativeInput & {
included: boolean;
};

export const initialConversion: Conversion = {
type: "",
urlPattern: "",
observationWindow: 0,
};

export const initialCreative: Creative = {
name: "",
advertiserId: "",
Expand Down Expand Up @@ -106,7 +93,6 @@ export const initialAdSet: AdSetForm = {
name: "",
isNotTargeting: false,
segments: [],
conversions: [],
oses: [],
creatives: [],
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { PickerFields } from "./fields/PickerFields";
import { ConversionField } from "./fields/ConversionField";
import { CardContainer } from "@/components/Card/CardContainer";
import { useHistory } from "react-router-dom";
import { FormikTextField, useIsEdit } from "@/form/FormikHelpers";
Expand All @@ -20,7 +19,6 @@ import { useLingui } from "@lingui/react";
export function AdSetFields() {
const { _ } = useLingui();
const history = useHistory();
const { isDraft } = useIsEdit();
const params = new URLSearchParams(history.location.search);
const current = Number(params.get("current") ?? 0);
const fakeCurrent = current + 1;
Expand All @@ -45,8 +43,6 @@ export function AdSetFields() {

<PickerFields index={current} />

{isDraft && <ConversionField index={current} />}

<AdSetAds index={current} />
</>
);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { AdSetForm, Creative, OS, Segment } from "../../../../../types";
import { FormikErrors } from "formik";
import { ConversionDisplay } from "@/components/Conversion/ConversionDisplay";
import { ReviewField } from "./ReviewField";
import { ReviewContainer } from "@/user/views/adsManager/views/advanced/components/review/components/ReviewContainer";
import { CampaignFormat } from "@/graphql-client/graphql";
Expand Down Expand Up @@ -54,10 +53,6 @@ export function AdSetReview({ adSet, idx, errors, format }: Props) {
value={mapToString(adSet.oses)}
error={hasErrors ? (adSetError?.oses as string) : ""}
/>
<ConversionDisplay
conversions={adSet.conversions}
convErrors={adSetError?.conversions}
/>
<CreativeSpecificPreview
options={included}
useSimpleHeader
Expand Down

0 comments on commit 738ece9

Please sign in to comment.