Skip to content

Commit

Permalink
Merge pull request #315 from AmbireTech/bid-for-weak-performing-sources
Browse files Browse the repository at this point in the history
Bid for weak performing sources
  • Loading branch information
ivopaunov authored Dec 9, 2024
2 parents d959a9f + 4b9d5f1 commit b0ea1b3
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/components/CampaignDetails/CampaignDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,11 @@ const CampaignDetails = ({ isAdminPanel }: { isAdminPanel?: boolean }) => {
campaign.targetingInput.inputs.advanced.aggressiveBidding ? 'Yes' : 'No'
}
/>
<CampaignDetailsRow
textSize="sm"
title="Loose source bidding"
value={campaign.targetingInput.inputs.advanced.looseSourceCTR ? 'Yes' : 'No'}
/>
<CampaignDetailsRow
textSize="sm"
title="Last modified by"
Expand Down
7 changes: 7 additions & 0 deletions src/components/CreateCampaign/CampaignSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ const CampaignSummary = ({ onLaunchClick }: { onLaunchClick: () => void }) => {
textSize="sm"
/>

<CampaignDetailsRow
lighterColor
title="Loose source bidding"
value={advancedTargeInput.looseSourceCTR ? 'Yes' : 'No'}
textSize="sm"
/>

<CampaignDetailsRow
lighterColor
title="Auto UTM tracking"
Expand Down
7 changes: 6 additions & 1 deletion src/components/CreateCampaign/StepFour/StepFour.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ const StepFour = () => {
title: 'Aggressive bidding',
value: advancedTargeInput.aggressiveBidding ? 'Yes' : 'No'
},
{
title: 'Loose source bidding',
value: advancedTargeInput.looseSourceCTR ? 'Yes' : 'No'
},
{ title: 'Campaign Period', value: campaignPeriodFormatted },
{ title: 'Placements', value: formattedSelectedPlacement },
{ title: 'Device Type', value: formattedSelectedDevice },
Expand All @@ -52,7 +56,8 @@ const StepFour = () => {
formattedCats,
formattedLocs,
advancedTargeInput.limitDailyAverageSpending,
advancedTargeInput.aggressiveBidding
advancedTargeInput.aggressiveBidding,
advancedTargeInput.looseSourceCTR
]
)

Expand Down
7 changes: 7 additions & 0 deletions src/components/CreateCampaign/StepThree/StepThree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,13 @@ const StepThree = () => {
(learn more)
</DefaultCustomAnchor>
</Group>
<Checkbox
label="Bid on loose sources"
key={key('targetingInput.inputs.advanced.looseSourceCTR')}
{...getInputProps('targetingInput.inputs.advanced.looseSourceCTR', {
type: 'checkbox'
})}
/>
</Stack>

<TextInput
Expand Down
9 changes: 8 additions & 1 deletion src/components/EditCampaign/EditCampaign.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ const EditCampaign = ({ campaign, isAdmin }: { campaign: Campaign; isAdmin?: boo
typeof value !== 'boolean' ? 'Invalid value' : null,
limitDailyAverageSpending: (value) =>
typeof value !== 'boolean' ? 'Invalid value' : null,
aggressiveBidding: (value) => (typeof value !== 'boolean' ? 'Invalid value' : null)
aggressiveBidding: (value) => (typeof value !== 'boolean' ? 'Invalid value' : null),
looseSourceCTR: (value) => (typeof value !== 'boolean' ? 'Invalid value' : null)
}
}
}
Expand Down Expand Up @@ -357,6 +358,12 @@ const EditCampaign = ({ campaign, isAdmin }: { campaign: Campaign; isAdmin?: boo
(learn more)
</DefaultCustomAnchor>
</Group>
<Checkbox
label="Bid on loose sources"
{...form.getInputProps('targetingInput.inputs.advanced.looseSourceCTR', {
type: 'checkbox'
})}
/>
</Stack>

<Button disabled={!form.isDirty()} size="lg" type="submit" maw={200}>
Expand Down
3 changes: 2 additions & 1 deletion src/constants/createCampaign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ export const CREATE_CAMPAIGN_DEFAULT_VALUE: CampaignUI = {
includeIncentivized: false,
disableFrequencyCapping: false,
limitDailyAverageSpending: false,
aggressiveBidding: false
aggressiveBidding: false,
looseSourceCTR: false
}
}
},
Expand Down

0 comments on commit b0ea1b3

Please sign in to comment.