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

[Native] Special characters on body / image / title from prebid.js to DFP #2854

Closed
haroldpussat opened this issue Jul 16, 2018 · 5 comments
Closed
Assignees
Labels

Comments

@haroldpussat
Copy link

Type of issue

Question

Description

We are testing native implementation from Prebid.js (1.16-pre). For this I create a simple test page with a native slot (size 1&1) and a simple mediaType declared as native. There is only appnexus in competition for the native slot.
I also create a native format and style on our DFP account.
What I see on my console is I get answer from Appnexus with "special characters" such as "€", "!", "*" and so on
For example :

hb_native_body_appne value: Votre hôtel 5* à Rennes à partir de 167 €

DFP troubleshooting tool show me the same native body value
image

But I'm not able to display the body content from a simple native format / style (based on http://prebid.org/adops/setting-up-prebid-native-in-dfp.html).
I put some console trace on my native style and it says body / image are empty
`
console.log("HPU Version Nativ 1.0e");

console.log('HPU LinkURL :' + '%%CLICK_URL_UNESC%%%%PATTERN:hb_native_linkurl%%');

console.log('HPU Brand :' + '%%PATTERN:hb_native_brand%%');

console.log('HPU Title :' + '%%PATTERN:hb_native_title%%');

console.log('HPU Body :' + '%%PATTERN:hb_native_body%%');

console.log('HPU Image :' + '%%PATTERN:hb_native_image%%');`

image

As a result, the native ad is not displayed correctly
image

So I updated the targeting.js from prebid in order to add a fixed encodeURIComponent on the value targeted value to DFP (see function : setTargetingForGPT)

image

On the native style, I also add decodedURIComponent for body, brand, title and image. With those changes,
image

I'm able to display the native ad on the test page
image

Steps to reproduce

1 - Prebid.js 1.*
2 - A native ad with body / image / title including with special characters such as "€", "!" or "*"

I don't know if I missed something on the implementation (on prebid or dfp setup) or if I'm mistaken or if it's a lack of knowledge or if it's a documentation issue

Test page

With prebid.js 1.16-pre :
http://www.precom-multimedia.com/interne/hpu/test_nativ2/?dfptest=50
With encodeURIComponent on Prebid and a decodeURIComponent on DFP Native Style :
http://www.precom-multimedia.com/interne/hpu/test_nativ2/index_custom.html?dfptest=40

Both pages are on Prebid debug mode

Expected results

Actual results

Without encode on prebid and decode from native style, I have blank hb_native_body / image

Platform details

PRebid 1.16-pre, Prebid 1.15
Chrome / Firefox (last versions)

Other information

@mkendall07 mkendall07 added the bug label Jul 23, 2018
@mkendall07
Copy link
Member

Thanks for the bug report. Would you mind opening a PR to resolve?

@haroldpussat
Copy link
Author

Thanks for the feedback, I never opened a pull request. I'll try to do it.

@haroldpussat
Copy link
Author

FYI, we built our own Prebid.js including encodeURIComponent on native key (impact on utils.js and targeting.js). So that we can decode them on DFP Native style and use a document.write to render the native ad.
We also update DFP lineItems so that we can receive SendallBids-> false.
Our custom Prebid.js is live on one of our production site with one native position : https://rennes.maville.com/ . We are monitoring the prebid / DFP on this site.

@wqi1972
Copy link
Collaborator

wqi1972 commented Oct 22, 2018

@haroldpussat , have you opened a pull request for this change?

@nanek
Copy link
Contributor

nanek commented Oct 24, 2018

#3224 is an attempt to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants