Okay
  Print

[StreamTube] Video Advertising

Since version 2.7.2, if you’re seeking a straightforward method to display ads on all videos, you can set a global Ad Tag by navigating to Customize > Theme Options > Advertising section.

To enable the display of custom ads, it is essential that your WordPress website is equipped to support an HTTPS connection. Additionally, the activation of CORS (Cross-Origin Resource Sharing) is a prerequisite by adding the following rules to the beginning of the htaccess file.

# BEGIN Advertising
# The directives (lines) between "BEGIN Advertising" and "END Advertising" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<ifmodule mod_headers.c="">
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Credentials true
</ifmodule>
# END Advertising

OR: 

# BEGIN Advertising
# The directives (lines) between "BEGIN Advertising" and "END Advertising" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<ifmodule mod_headers.c="">
    Header set Access-Control-Allow-Origin "https://imasdk.googleapis.com"
    Header set Access-Control-Allow-Credentials true
</ifmodule>
# END Advertising

The display of ads might be influenced when an adblocker is activated.

Add AdTag


Navigate to Advertising > Ad Tags > Add New

  1. Add Title: Enter a custom title
  2. Ad Server: Select the Ad server you want to run:
    1. Self Ad: run your own Ad, video and image media types are supported.
    2. VAST-compliant Ad Server: run Ads from another Ad server such as Google Ad Manager, Google AdSense network, or any VAST-compliant ad server.
  3. Target URL: Set a custom target URL which will be opened when clicking on the Ad, this option only supports Self Ad
  4. Ad Type: Linear or NonLinear
  5. Duration: Duration of your video Ad
  6. Upload your own video files from WordPress media, multiple resolutions are supported
  7. Skippable: Allow viewers to skip ads after x seconds
  8. Save changes

You can create many ad tags as you wish with different content

Custom Image Ad



Custom Image and Video Ad


Custom Video Ad


Import custom Vast Tag



Add Ad Schedule


Navigate to Advertising > Ad Schedules > Add New

  1. Add Title: Enter a custom title
  2. Enable this Schedule: check on this option to enable Ad schedule, otherwise, Ad schedule won't work.
  3. Ad Tag URL: your own Ad Tag URL, try to open this URL on browser, if you get an 404 error page, you will need to navigate Settings > Permalinks page and hit the Save Changes button to update permalinks, please note that you have to update the Ad Schedule before opening this URL
  4. Start Date: Date to start the schedule, required
  5. End Date: Date to stop the schedule, required
  6. New Ad: Add the ad tags that you added earlier, you can also select Pre-roll, Mid-roll or Post-roll while adding Ad tag
  7. Save changes

Set Ads For Special Videos


Edit the video you want to set Ads for

  1. Disable Advertising: Don't run any Ads on this video content
  2. Ad Schedules: Select the Ad Schedules you want to run on this video content

Advertisements will not appear if:

  1. The current logged-in user is an admin, editor, or the video owner.
  2. The current logged-in user has paid for the video content or holds a membership level associated with the video.
  3. CORS isn't enabled.
  4. A browser adblocker is enabled.