The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Help with Advertising Code
Hello all you experts out there.
I'm working with a new advertising partner...and they provided me with some ad code for a video advertisement. Problem is...the video ad code doesn't seem to include any sizing information...so the video will play full size in whatever window size the browser is running. The larger the browser window...the larger the video ad...the smaller the window...the smaller the window the video will play in. No matter what size the browser window is...this video ad will play full-size in that window. I would like the video to play at a fixed size (let's say 700px wide)...no matter what size browser window is being used by the user. Here's the ad code I've been provided...can someone take a look at it...and please modify it with some code that will force it to run in a fixed size window (700px wide for example)...or please let me know what & where some code needs to be added so it runs in a fixed size window. <script> (function (d,s,n,id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.className = n; js.src = "https://stream.xyz.com/embed/sdk.js?embedId=333cf05e-c1be-499e-53a2-1234c311fe7d"; fjs.parentNode.insertBefore(js, fjs); }(document,'script?,?xyz-stream','stream-sdk-jssdk_xyz.com')); </script> <div id=?333cf05e-c1be-499e-53a2-1234c311fe7d"></div> Thanks very much. |
#2
|
||||
|
||||
My Malwarebytes Pro blocks the js source url as a trojan - I'd go nowhere near that ad provider.
|
#3
|
|||
|
|||
Quote:
What I need to know is how to augment this code so that the video ad plays in a smaller size fixed space...since at the moment it only plays full screen. Please modify or let me know how to modify it...and I will repost with the results. Something like 700px wide would work ok. Thanks |
#4
|
|||
|
|||
You can try giving the div a fixed width/height, but JavaScript can override that so I'm not sure if that will actually work. Generally those ad scripts have options to specify a maximum width/height.
HTML Code:
<div id="333cf05e-c1be-499e-53a2-1234c311fe7d" style="height: 200px; width: 700px;"></div> |
#5
|
|||
|
|||
Hello Dave...thanks very much for the help.
I tried the modification suggested...but unfortunately the video ad still plays in full screen (full size of the browser window). Any more suggestions please? I really want to get this working. Thanks --------------- Added [DATE]1565818420[/DATE] at [TIME]1565818420[/TIME] --------------- This is what the full ad code looks like after the modification Dave suggested: <script> (function (d,s,n,id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.className = n; js.src = "https://stream.xyz.com/embed/sdk.js?embedId=333cf05e-c1be-499e-53a2-1234c311fe7d"; fjs.parentNode.insertBefore(js, fjs); }(document,'script?,?xyz-stream','stream-sdk-jssdk_xyz.com')); </script> <div id=?333cf05e-c1be-499e-53a2-1234c311fe7d" style=?height: 200px; width: 700px;?></div> |
#6
|
|||
|
|||
Have you tried asking the ad company or checked out their API documentation?
|
#7
|
|||
|
|||
Quote:
This is why I was hoping to find a solution from the many experts here at vBulletin.org. If there is a solution...I would think this is the place to find it! Thanks |
#8
|
|||
|
|||
Well this is not specific to vBulletin though, this is just regarding forcing an ad to specific dimensions. Nearly all ad provider have this feature as part of their JavaScript library or API so you probably should rethink the ad provider you're using now...
|
#9
|
||||
|
||||
Advertisers set the size of their ads. If you change that you are likely violating your terms of service agreement with them. They usually hardcode the ad size into their JS code because the average user won't know how to set the ad size.
If you want a case-in-point example Google will demonetize your AdSense if they find you are changing the size of their ads on YouTube videos. |
#10
|
|||
|
|||
Hello Dave & In Omnibus...thanks for the great replies.
Yes I definitely hear you regarding the ad code from ad partners already including size/dimension code within the ad code they supply. I have worked (or am currently working with) at least 5-7 different ad partners...and all of them have included size info in the code they supply. This includes Adsense, Media.net, Amazon Associates...and others. I've mentioned this to this specific ad supplier...and up to this point they really haven't offered a solution where the "ad dimension code" is included within the ad code they supply. What they seem to want me to do is...modify the vBulletin templates so their ads run in a size that's works for my website (modify the ad container size in the vBulletin templates). I really would rather not do this...since this will fix this ad location to just one size ad...and I'm pretty sure (from experience)...that the vBulletin ad locations/containers are responsive (many ad sizes will work). Also...if I then decide in the future...to work with a different ad partner...or move this specific ad to a different location on the website...then the template that was modified will need to be modified back to it's original unaltered vBulletin code. This can be done of course...but a lot of unnecessary modifying...since the ad supplier should supply ad code that works without needing to modify templates. If anyone has any other ideas on how to modify the ad code so it doesn't run full size (full size in the browser window)...that would be awesome! Thanks again for the help. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|