Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update conditional ad unit - replace references to "global sizeConfig" with "size mapping" #5476

Merged
merged 2 commits into from
Jul 8, 2024
Merged
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
13 changes: 6 additions & 7 deletions dev-docs/conditional-ad-units.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sidebarType: 1

{:.no_toc}

The [global sizeConfig](/dev-docs/publisher-api-reference/setConfig.html#setConfig-Configure-Responsive-Ads) and [Advanced Size Mapping](/dev-docs/modules/sizeMappingV2.html) features are useful for standard responsive ad designs, but a number of other scenarios are supported as well.
The [Size Mapping](/dev-docs/modules/sizeMapping.html) and [Advanced Size Mapping](/dev-docs/modules/sizeMappingV2.html) features are useful for standard responsive ad designs, but a number of other scenarios are supported as well.

* TOC
{:toc}
Expand All @@ -31,7 +31,7 @@ See the [Publisher API reference](/dev-docs/publisher-api-reference/setConfig.ht
## Some Bidders Should Be Skipped for Some Devices

{: .alert.alert-info :}
See the [Advanced Size Mapping module](/dev-docs/modules/sizeMappingV2.html) for another way to handle this scenario. Note that you must use Advanced Size Mapping for mediaTypes other than banner.
The following example uses [Size Mapping](/dev-docs/modules/sizeMapping.html). See the [Advanced Size Mapping module](/dev-docs/modules/sizeMappingV2.html) for another way to handle this scenario. Note that you must use Advanced Size Mapping for mediaTypes other than banner.

Say a particular bidder is focused on mobile phone demand, so it's really not worthwhile
to send them requests from display or tablets.
Expand Down Expand Up @@ -108,7 +108,7 @@ For instance, say that a given bidder wants to define different placements for d
| Display | 1111 |
| Phones and tablets | 2222 |

### Using the Global sizeConfig Approach (Banner only)
### Using the Size Mapping Approach (Banner only)

Assuming the same `sizeConfig` as in the first use case above, the AdUnit would contain bids for both
placements, but the conditional `labelAny` is added to them both. This will cause the bid to be fired only if one
Expand Down Expand Up @@ -191,7 +191,7 @@ var AdUnits = [{
## Some Ad Unit Auctions Should Be Skipped Entirely for Some Devices

Say there's a responsive page where one of the ad units only supports larger sizes, so it doesn't make sense
on phones. To suppress the ad unit for mobile users, we can apply conditional logic to the entire ad unit. Here's an example using the global sizeConfig approach (banner only):
on phones. To suppress the ad unit for mobile users, we can apply conditional logic to the entire ad unit. Here's an example using the size mapping approach (banner only):

```javascript

Expand All @@ -218,11 +218,10 @@ var AdUnits = [{
}
]
}]
```

See the [Advanced Size Mapping module](/dev-docs/modules/sizeMappingV2.html) if you need to do something like this for video.

```

## Some Bid Requests Apply Only to Users Originating from Certain Countries

Labels aren't constrained to describing device size -- they can be used for many types of conditions the page maywant to define. Besides being defined as part of `sizeConfig`, labels can also be passed into the [`requestBids()`](/dev-docs/publisher-api-reference/requestBids.html) function as an argument.
Expand Down Expand Up @@ -271,6 +270,6 @@ labels:

## Further Reading

* [Responsive ad designs](/dev-docs/publisher-api-reference/setConfig.html#setConfig-Configure-Responsive-Ads)
* [Size Mapping Module](/dev-docs/modules/sizeMapping.html)
* [Advanced Size Mapping Module](/dev-docs/modules/sizeMappingV2.html)
* [Using Media Queries](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries)