Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-14-2019, 03:56 PM
alfuzzy alfuzzy is offline
 
Join Date: Jul 2018
Posts: 168
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
  #2  
Old 08-14-2019, 04:09 PM
z3r0's Avatar
z3r0 z3r0 is offline
 
Join Date: Apr 2005
Posts: 339
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

My Malwarebytes Pro blocks the js source url as a trojan - I'd go nowhere near that ad provider.
Reply With Quote
  #3  
Old 08-14-2019, 06:28 PM
alfuzzy alfuzzy is offline
 
Join Date: Jul 2018
Posts: 168
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by z3r0 View Post
My Malwarebytes Pro blocks the js source url as a trojan - I'd go nowhere near that ad provider.
I modified the source URL on purpose...so as to protect the identity of the supplier of the code & my website...thus any Malwarebytes results are not necessary.

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
Reply With Quote
  #4  
Old 08-14-2019, 06:58 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
Reply With Quote
  #5  
Old 08-14-2019, 07:31 PM
alfuzzy alfuzzy is offline
 
Join Date: Jul 2018
Posts: 168
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
Reply With Quote
  #6  
Old 08-14-2019, 08:47 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Have you tried asking the ad company or checked out their API documentation?
Reply With Quote
  #7  
Old 08-15-2019, 09:37 AM
alfuzzy alfuzzy is offline
 
Join Date: Jul 2018
Posts: 168
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dave View Post
Have you tried asking the ad company or checked out their API documentation?
Ohh yes definitely. The ad companies tech team has looked into it...but nothing they've suggested thus far has worked. I have a feeling they may not be very familiar working with vBulletin websites.

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
Reply With Quote
  #8  
Old 08-15-2019, 10:46 AM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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...
Reply With Quote
  #9  
Old 08-15-2019, 12:18 PM
In Omnibus's Avatar
In Omnibus In Omnibus is offline
 
Join Date: Apr 2010
Location: Inside A Blade Server
Posts: 840
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #10  
Old 08-15-2019, 02:40 PM
alfuzzy alfuzzy is offline
 
Join Date: Jul 2018
Posts: 168
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:14 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05740 seconds
  • Memory Usage 2,253KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_html
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete