Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
f40ec3c
WURFL-devicedetection module implementation (compatible with PBS Java…
andreacastello Jan 17, 2025
eef4efc
updated README.md
andreacastello Jan 17, 2025
12eb97c
updated README.md title
andreacastello Jan 17, 2025
da8fd51
some README.md wording improvements
andreacastello Jan 17, 2025
c0dd077
used markdown table for config params.
andreacastello Jan 17, 2025
39bf6d7
added maintainer email address
andreacastello Jan 17, 2025
3aff037
modified sample request data
andreacastello Jan 17, 2025
eedc3e0
fixed typos
andreacastello Jan 17, 2025
cac7b71
Merge pull request #1 from WURFL/module-wurfl-devicedetection
andreacastello Jan 17, 2025
0e93e64
improved wording
andreacastello Jan 17, 2025
89cb0dd
improved published specific enrichment paragraph
andreacastello Jan 17, 2025
7a55ba2
better doc formatting
andreacastello Jan 17, 2025
9d95efd
Merged upstream master branch to local master
andreacastello Feb 21, 2025
93f3182
Updated WURFL API version, uncommented module add into modules pom. M…
andreacastello Feb 24, 2025
96d91e4
Added WURFL API mock classes
andreacastello Feb 25, 2025
9b8b10e
checkstyle compliance
andreacastello Feb 25, 2025
1bd2865
Updated README. More checkstyle compliance
andreacastello Feb 25, 2025
cee250a
Removed commented dependency
andreacastello Feb 27, 2025
59fe1a6
Improved WURFL module README.md
andreacastello Mar 3, 2025
c0fe0db
Merge pull request #2 from WURFL/module-wurfl-devicedetection
andreacastello Mar 3, 2025
a4fcd1f
potential mock issue fix
andreacastello Mar 3, 2025
958f7c1
Merge pull request #3 from WURFL/module-wurfl-devicedetection
andreacastello Mar 4, 2025
f5bf2e3
WURFL module: improved README
andreacastello Mar 6, 2025
57d2378
WURFL module README: better wording
andreacastello Mar 6, 2025
93cbf8c
WURFL module README: more doc improvement
andreacastello Mar 6, 2025
ffe67fa
PREB-39: simplified call to virtual capabilities API
andreacastello Mar 6, 2025
6af13df
Merge pull request #4 from WURFL/PREB-39
andreacastello Mar 6, 2025
7cf5ccd
Merge branch 'prebid:master' into master
andreacastello Mar 10, 2025
1cbb9b6
Updated WURFL module version to 3.23.0-SNAPSHOT
andreacastello Mar 10, 2025
b846032
Added a WURFL API mock dependency from a public repo. Updated README …
andreacastello Mar 12, 2025
bc21beb
More README update
andreacastello Mar 12, 2025
1215903
Merge pull request #6 from WURFL/wurfl-module-with-mock-from-repo
andreacastello Mar 12, 2025
0850daa
Used WURFL lowecase in module names
andreacastello Mar 12, 2025
e559a6f
removed unused log
andreacastello Mar 12, 2025
8d712ef
handled exception in virtual capability retrieval
andreacastello Mar 12, 2025
4155848
removed print stacktrace used for debug
andreacastello Mar 13, 2025
b596b5f
Merge pull request #7 from WURFL/wurfl-module-with-mock-from-repo
andreacastello Mar 13, 2025
2034a74
Merge branch 'prebid:master' into master
andreacastello Apr 7, 2025
b5466cb
PREB-41: used FileSyncer and FileProcessor to update WURFL file and e…
andreacastello Apr 7, 2025
2c12d92
PREB-41: removed logs
andreacastello Apr 7, 2025
de636c5
PREB-41: added comment
andreacastello Apr 7, 2025
b4b9c88
Merge pull request #9 from WURFL/PREB-41-new
andreacastello Apr 7, 2025
467216f
Item 3, 4, 6, 7, 8 or review: code formatting and move, removal of un…
andreacastello Apr 11, 2025
79fffc7
Items 12, 13 of PR review: remove final modifier in method parameters…
andreacastello Apr 11, 2025
c95afa9
Item 1,2 of Pr review: moved module configuration, removed internal y…
andreacastello Apr 11, 2025
e3f4fa0
Merge pull request #10 from WURFL/PR-3685-review-pass-01-config-move
andreacastello Apr 11, 2025
1320e19
Item 5 of Pr review: removed wurfl prefix from config properties vari…
andreacastello Apr 11, 2025
00c7f20
checkstyle fixes
andreacastello Apr 11, 2025
90af0a7
Item 10 of Pr review: used internal filesyncer backup to rollback WUR…
andreacastello Apr 15, 2025
3c7e544
Item 11 of PR review: removed hardcoded file names in filesyncer
andreacastello Apr 15, 2025
ca17447
Item 10, 11 of PR review: made update process configurable, fixed iss…
andreacastello Apr 17, 2025
a2395b0
Improved check on updater frequency setting
andreacastello Apr 18, 2025
c5c27f7
Updated documentation
andreacastello Apr 18, 2025
67320fb
Merge pull request #11 from WURFL/PR-3685-review-pass-01
andreacastello Apr 18, 2025
d24eaa5
Merge branch 'prebid:master' into master
andreacastello Apr 29, 2025
66435b7
Aligned version after latest PBS release. Some checkstyle fixes on ne…
andreacastello Apr 29, 2025
ac8ae16
Merge branch 'prebid:master' into master
andreacastello May 22, 2025
9d91879
Merge branch 'prebid:master' into master
andreacastello Jun 5, 2025
81895d6
Merge branch 'prebid:master' into master
andreacastello Jun 11, 2025
dae9659
Updated version number in WURFL module
andreacastello Jun 11, 2025
3109b57
Item 1 of review pass 2
andreacastello Jun 11, 2025
b0c9c0d
Item 2 of review pass 2
andreacastello Jun 11, 2025
b4087d3
Used @Value lombok annotation in place of @Getter in AuctionRequestHe…
andreacastello Jun 12, 2025
8760b20
Refactored static and virtual capability retrieval in ExtWURFLMapper …
andreacastello Jun 12, 2025
e8661d5
Removed constant that's not used anymore
andreacastello Jun 12, 2025
9cd9fc3
Simplified ext device mapping: Replaced Map with Set in OrtbDeviceUpd…
andreacastello Jun 12, 2025
422bea9
Removed PlatformNameVersion class (just a wrapper on BrandVersion class)
andreacastello Jun 12, 2025
f027eeb
Removed AccountValidator class, moved its single method to hook class…
andreacastello Jun 13, 2025
90fb9b8
Merge branch 'prebid:master' into PR-3685-pass-2
andreacastello Jun 13, 2025
75b4b3f
Bumped version to 3.28
andreacastello Jun 13, 2025
fb8fc7b
made a method protected
andreacastello Jun 13, 2025
f2e15f3
Merge branch 'prebid:master' into master
andreacastello Jun 13, 2025
bfdd5df
made a createFileSyncer private
andreacastello Jun 13, 2025
f8131d8
made a createFileSyncer private
andreacastello Jun 13, 2025
b22b93c
made a createFileSyncer private
andreacastello Jun 13, 2025
7bdbbfc
Merge branch 'master' into PR-3685-pass-2
andreacastello Jun 13, 2025
1b43e5b
Merge pull request #13 from WURFL/PR-3685-pass-2
andreacastello Jun 13, 2025
01c2ea9
Removed usage of the annotation @Slf4j
andreacastello Jun 24, 2025
9f28869
Removed usage of annotation @Slf4j in favor of classic log instantiat…
andreacastello Jun 25, 2025
81cc02c
Moved Sec-CH-* header names to HttpUtil class. Removed empty lines af…
andreacastello Jun 25, 2025
083d2d4
Renamed WURFLModuleConfigurationException to WURFLDeviceDetectionExce…
andreacastello Jun 25, 2025
4152085
Used objectMapperProvider to create mapper. Used HttpUtil in HeadersR…
andreacastello Jun 25, 2025
2e5de58
Refactored resolve method to avoid "escape" usage
andreacastello Jun 25, 2025
389db27
removed residual empty lines under method declarations
andreacastello Jun 25, 2025
8b287b5
Merge pull request #14 from WURFL/PR-3685-pass-2
andreacastello Jun 25, 2025
367f136
Merge branch 'prebid:master' into master
andreacastello Jul 17, 2025
1fe287c
Updated version number in WURFL module
andreacastello Jul 17, 2025
3638545
made HeadersResolver a static utility class. Code formatting. Items 1…
andreacastello Jul 17, 2025
93dceeb
Used Set for allowedPublisherIDs. Item 17 of PR 3685 review pass 3
andreacastello Jul 17, 2025
30016f2
Refactoring of device update process and auction request hook
andreacastello Jul 17, 2025
36372d6
Merge pull request #15 from WURFL/PR-3685-pass-3
andreacastello Jul 18, 2025
9a1f2aa
More refactoring of device update process for exception handling
andreacastello Jul 21, 2025
abb8c92
Merge pull request #16 from WURFL/PR-3685-pass-4
andreacastello Jul 21, 2025
96b22ee
Made all test classes and methods public
andreacastello Jul 21, 2025
2cf4486
Unit tests revision
andreacastello Jul 22, 2025
f75eb8a
Merge pull request #17 from WURFL/PR-3685-pass-4
andreacastello Jul 22, 2025
7297dcd
Unit tests revision - part 2
andreacastello Jul 23, 2025
66f1f86
Code cleanup
andreacastello Jul 24, 2025
60c0ad8
OOH device type handling
andreacastello Jul 24, 2025
de5027a
reverted return in getWurflDeviceType
andreacastello Jul 24, 2025
ab13bd9
Merge pull request #18 from WURFL/deviceType-dooh-handling
andreacastello Jul 24, 2025
c181745
Merge branch 'prebid:master' into master
andreacastello Jul 24, 2025
213b823
Minor doc update
andreacastello Jul 24, 2025
0d284cb
Minor doc update - 2
andreacastello Jul 24, 2025
a6c70cf
Merge branch 'master' into wurfl-device-detection-conflicts-merge
andreacastello Aug 1, 2025
42eae26
Updated WURFL module version to 3.30.0-snapshot
andreacastello Aug 1, 2025
e3015a9
Fixed merge issue
andreacastello Aug 1, 2025
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
5 changes: 5 additions & 0 deletions extra/bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@
<artifactId>optable-targeting</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.prebid.server.hooks.modules</groupId>
<artifactId>wurfl-devicedetection</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>

<build>
Expand Down
1 change: 1 addition & 0 deletions extra/modules/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<module>greenbids-real-time-data</module>
<module>pb-request-correction</module>
<module>optable-targeting</module>
<module>wurfl-devicedetection</module>
</modules>

<dependencyManagement>
Expand Down
250 changes: 250 additions & 0 deletions extra/modules/wurfl-devicedetection/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,250 @@
## WURFL Device Enrichment Module

### Overview

The **WURFL Device Enrichment Module** for Prebid Server enhances the OpenRTB 2.x payload
with comprehensive device detection data powered by **ScientiaMobile**’s WURFL device detection framework.
Thanks to WURFL's device knowledge, the module provides accurate and comprehensive device-related information,
enabling bidders to make better-informed targeting and optimization decisions.

### Key features

#### Device Field Enrichment:

The WURFL module populates missing or empty fields in ortb2.device with the following data:
- **make**: Manufacturer of the device (e.g., "Apple", "Samsung").
- **model**: Device model (e.g., "iPhone 14", "Galaxy S22").
- **os**: Operating system (e.g., "iOS", "Android").
- **osv**: Operating system version (e.g., "16.0", "12.0").
- **h**: Screen height in pixels.
- **w**: Screen width in pixels.
- **ppi**: Screen pixels per inch (PPI).
- **pxratio**: Screen pixel density ratio.
- **devicetype**: Device type (e.g., mobile, tablet, desktop).
- **js**: Support for JavaScript, where 0 = no, 1 = yes
- **Note**: If these fields are already populated in the bid request, the module will not overwrite them.

#### Publisher-Specific Enrichment:

Device enrichment is selectively enabled for publishers based on their account ID.
The module identifies publishers through the following fields:

`site.publisher.id` (for web environments).
`app.publisher.id` (for mobile app environments).
`dooh.publisher.id` (for digital out-of-home environments).


### Building WURFL Module with a licensed WURFL Onsite Java API

In order to compile the WURFL module in the PBS Java server bundle using a licensed WURFL API, you must follow these steps:

1 - Change the URL in the `<repository>` tag in the module's `pom.xml` file to the ScientiaMobile Maven repository URL:

`https://maven.scientiamobile.com/repository/wurfl-onsite/`

The repository is private and requires authentication: to set it up please check the paragraph
"Configuring your Builds to work with ScientiaMobile's Private Maven Repository"
[on this page](https://docs.scientiamobile.com/documentation/onsite/onsite-java-api).

2 - Change the `artfactId` value in the module's `pom.xml` from `wurfl-mock` to `wurfl`

3 - Update the `wurfl.version` property value to the latest WURFL Onsite Java API version available.


When the `pom.xml` references the mock API artifact, the module will compile a demo version that returns sample data,
allowing basic testing without an WURFL Onsite Java API license.

4 - Build the Prebid Server Java bundle with the WURFL module using the following command:

```bash
mvn clean package --file extra/pom.xml
```

### Configuring the WURFL Module

Below is a sample configuration for the WURFL module:

```yaml
hooks:
wurfl-devicedetection:
enabled: true
host-execution-plan: >
{
"endpoints": {
"/openrtb2/auction": {
"stages": {
"entrypoint": {
"groups": [
{
"timeout": 10,
"hook_sequence": [
{
"module_code": "wurfl-devicedetection",
"hook_impl_code": "wurfl-devicedetection-entrypoint-hook"
}
]
}
]
},
"raw_auction_request": {
"groups": [
{
"timeout": 10,
"hook_sequence": [
{
"module_code": "wurfl-devicedetection",
"hook_impl_code": "wurfl-devicedetection-raw-auction-request"
}
]
}
]
}
}
}
}
}
modules:
wurfl-devicedetection:
file-dir-path: </path/to/wurfl_snapshot_dir>
file-snapshot-url: https://data.scientiamobile.com/<your_wurfl_snapshot_url>/wurfl.zip
cache-size: 200000
update-frequency-in-hours: 24
allowed-publisher-ids: 1
ext-caps: false
```

### Configuration Options

| Parameter | Requirement | Description |
|---------------------------------|-------------|---------------------------------------------------------------------------------------------------|
| **`file-dir-path`** | Mandatory | Path to the directory where the WURFL file is downloaded. Directory must exist and be writable. |
| **`file-snapshot-url`** | Mandatory | URL of the licensed WURFL snapshot file to be downloaded when Prebid Server Java starts. |
| **`cache-size`** | Optional | Maximum number of devices stored in the WURFL cache. Defaults to the WURFL cache's standard size. |
| **`ext-caps`** | Optional | If `true`, the module adds all licensed capabilities to the `device.ext` object. |
| **`update-frequency-in-hours`** | Optional | Check interval (hours) for downloading updated wurfl file if modified. Defaults to 24 hours |
| **`allowed-publisher-ids`** | Optional | List of publisher IDs permitted to use the module. Defaults to all publishers. |


A valid WURFL license must include all the required capabilities for device enrichment.

### Launching Prebid Server Java with the WURFL Module

After configuring the module and successfully building the Prebid Server bundle, start the server with the following command:

```bash
java -jar target/prebid-server-bundle.jar --spring.config.additional-location=sample/configs/prebid-config-with-wurfl.yaml
```

This sample configuration contains the module hook basic configuration.

When the server starts, it downloads the WURFL file from the `wurfl-snapshot-url` and loads it into the module.

Sample request data for testing is available in the module's `sample` directory. Using the `auction` endpoint,
you can observe WURFL-enriched device data in the response.

### Sample Response

Using the sample request data via `curl` when the module is configured with `ext-caps` set to `false` (or no value)

```bash
curl http://localhost:8080/openrtb2/auction --data @extra/modules/wurfl-devicedetection/sample/request_data.json
```

the device object in the response will include WURFL device detection data:

```json
"device": {
"ua": "Mozilla/5.0 (Linux; Android 15; Pixel 9 Pro XL Build/AP3A.241005.015;) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Mobile Safari/537.36 EdgA/124.0.2478.64",
"devicetype": 1,
"make": "Google",
"model": "Pixel 9 Pro XL",
"os": "Android",
"osv": "15",
"h": 2992,
"w": 1344,
"ppi": 481,
"pxratio": 2.55,
"js": 1,
"ext": {
"wurfl": {
"wurfl_id": "google_pixel_9_pro_xl_ver1_suban150"
}
}
}
```

When `ext_caps` is set to `true`, the response will include all licensed capabilities:

```json
"device":{
"ua":"Mozilla/5.0 (Linux; Android 15; Pixel 9 Pro XL Build/AP3A.241005.015; ) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Mobile Safari/537.36 EdgA/124.0.2478.64",
"devicetype":1,
"make":"Google",
"model":"Pixel 9 Pro XL",
"os":"Android",
"osv":"15",
"h":2992,
"w":1344,
"ppi":481,
"pxratio":2.55,
"js":1,
"ext":{
"wurfl":{
"wurfl_id":"google_pixel_9_pro_xl_ver1_suban150",
"mobile_browser_version":"",
"resolution_height":"2992",
"resolution_width":"1344",
"is_wireless_device":"true",
"is_tablet":"false",
"physical_form_factor":"phone_phablet",
"ajax_support_javascript":"true",
"preferred_markup":"html_web_4_0",
"brand_name":"Google",
"can_assign_phone_number":"true",
"xhtml_support_level":"4",
"ux_full_desktop":"false",
"device_os":"Android",
"physical_screen_width":"71",
"is_connected_tv":"false",
"is_smarttv":"false",
"physical_screen_height":"158",
"model_name":"Pixel 9 Pro XL",
"is_ott":"false",
"density_class":"2.55",
"marketing_name":"",
"device_os_version":"15.0",
"mobile_browser":"Chrome Mobile",
"pointing_method":"touchscreen",
"is_app_webview":"false",
"advertised_app_name":"Edge Browser",
"is_smartphone":"true",
"is_robot":"false",
"advertised_device_os":"Android",
"is_largescreen":"true",
"is_android":"true",
"is_xhtmlmp_preferred":"false",
"device_name":"Google Pixel 9 Pro XL",
"is_ios":"false",
"is_touchscreen":"true",
"is_wml_preferred":"false",
"is_app":"false",
"is_mobile":"true",
"is_phone":"true",
"is_full_desktop":"false",
"is_generic":"false",
"advertised_browser":"Edge",
"complete_device_name":"Google Pixel 9 Pro XL",
"advertised_browser_version":"124.0.2478.64",
"is_html_preferred":"true",
"is_windows_phone":"false",
"pixel_density":"481",
"form_factor":"Smartphone",
"advertised_device_os_version":"15"
}
}
}
```

## Maintainer

prebid@scientiamobile.com
34 changes: 34 additions & 0 deletions extra/modules/wurfl-devicedetection/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.prebid.server.hooks.modules</groupId>
<artifactId>all-modules</artifactId>
<version>3.30.0-SNAPSHOT</version>
</parent>

<artifactId>wurfl-devicedetection</artifactId>

<name>wurfl-devicedetection</name>
<description>WURFL device detection and data enrichment module</description>

<properties>
<wurfl.version>1.0.0.0</wurfl.version>
</properties>

<repositories>
<repository>
<id>com.scientiamobile.wurfl</id>
<url>https://maven.scientiamobile.com/repository/wurfl-onsite-tools/</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>com.scientiamobile.wurfl</groupId>
<artifactId>wurfl-mock</artifactId>
<version>${wurfl.version}</version>
</dependency>
</dependencies>
</project>
Loading
Loading