Skip to content

Commit

Permalink
Merge pull request #27499 from guardian/ih/add-liveblog-targeting
Browse files Browse the repository at this point in the history
Add tv-and-radio to isLiveblogTopTargetingSection in Dfp
  • Loading branch information
i-hardy authored Sep 25, 2024
2 parents a110628 + e380dc9 commit 352e9a7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ <h1>LiveBlog Top Sponsorships</h1>
<ol>
<li>Is a Sponsorship</li>
<li>Targets the <pre>liveblog-top</pre> slot</li>
<li>Targets the <pre>culture</pre>,<pre>sport</pre> or <pre>football</pre> section</li>
<li>Targets the <pre>culture</pre>, <pre>tv-and-radio</pre>, <pre>sport</pre> or <pre>football</pre> section</li>
<li>Targets the <pre>liveblog</pre> content type</li>
<li>Targets the <pre>mobile</pre> breakpoint</li>
<li>[Optional] Targets an edition</li>
Expand Down
7 changes: 6 additions & 1 deletion common/app/common/dfp/DfpData.scala
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ case class CustomTarget(name: String, op: String, values: Seq[String]) {
def isPlatform(value: String): Boolean = isPositive("p") && values.contains(value)
def isNotPlatform(value: String): Boolean = isNegative("p") && values.contains(value)

def matchesLiveBlogTopTargeting: Boolean = {
val liveBlogTopSectionTargets = List("culture", "football", "sport", "tv-and-radio")
values.intersect(liveBlogTopSectionTargets).nonEmpty
}

val isHighMerchandisingSlot = isSlot("merchandising-high")

val isLiveblogTopSlot = isSlot("liveblog-top")
Expand All @@ -91,7 +96,7 @@ case class CustomTarget(name: String, op: String, values: Seq[String]) {
val isSectionTag = isPositive("s")

val isLiveBlogTopTargetedSection =
isSectionTag && (values.contains("culture") || values.contains("sport") || values.contains("football"))
isSectionTag && matchesLiveBlogTopTargeting
}

object CustomTarget {
Expand Down

0 comments on commit 352e9a7

Please sign in to comment.