Skip to content

GoogleAds_IMA Videos Ads on your page

Daniel Neto edited this page Jan 8, 2025 · 13 revisions

The GoogleAds_IMA plugin integrates with the Google IMA SDK, supporting VAST 3.0 and VPAID 2 JS standards. Despite its name, the plugin is not limited to Google Ads services. It works with any VAST-compliant ad server, offering powerful customization and control over video ad placement.


Configuration and Usage

1. Apply for an AdSense account or another VAST-compatible service

  • Follow the service's approval process.
  • Upon approval, you will receive a publisher ID for live video ads.

2. Remove testing parameters

  • Ensure all instances of adtest=on are removed for ads to function in a live environment.

3. Refer to Google AdSense if needed

  • For help with the AdSense setup process, refer to their tutorial here.

Working Beyond Google

The plugin is compatible with any VAST-compliant ad server. If you’re not using Google Ads, consider exploring other providers. A useful list of ad server companies is available for reference.


Configuration Parameters

1. Ad Tag URLs

  • Parameter: adTagUrl
  • Description: The main URL for serving ads.
  • Default Value: A sample URL provided for Google Ads.
  • Configuration: Replace this with your VAST-compliant ad server URL(s). Multiple URLs can be added, separated by semicolons (;).

Ad Tag URL for Kids

  • Parameter: adTagUrlForKids
  • Description: Used for videos marked as "made for kids."
  • Configuration: Provide a separate URL tailored for kid-safe ads.

2. Pre-Roll Ads

  • Parameter: preAdTagUrl
  • Description: This URL is used specifically for pre-roll ads, which play before the video starts.
  • Configuration: Add a dedicated pre-roll tag if required.

3. Ad Timing Settings

Ad Timing Options

  • Start:
    • Parameter: start
    • Description: Enables ads at the start of the video.
  • 25% Progress:
    • Parameter: mid25Percent
    • Description: Plays ads when 25% of the video is watched.
  • 50% Progress:
    • Parameter: mid50Percent
    • Description: Plays ads when 50% of the video is watched.
  • 75% Progress:
    • Parameter: mid75Percent
    • Description: Plays ads when 75% of the video is watched.
  • End:
    • Parameter: end
    • Description: Enables ads at the end of the video.

Show AD in a Specific Time

The plugin allows you to define when ads should play during videos or live streams. The configuration works seamlessly for both Video On Demand (VOD) and live streams using the following rules:


1. Specific Moments
  • Provide exact times, separated by commas (e.g., 10,60,130,190). Ads will play at these specific moments during the video or live stream:
    • Example: 10,60,130,190 will play ads at 10, 60, 130, and 190 seconds.
  • Important: If more than 4 times are specified, ads will play only at these specific moments and will not repeat at regular intervals.

2. Repeating Intervals
  • For repeating ads during videos or live streams, provide 1, 2, or 3 values:
    • Single Value:
      • Example: 60
        Ads will repeat every 60 seconds (e.g., 60, 120, 180...).
    • Two Values:
      • Valid formats specify pre-roll or post-roll combined with an interval:
        • 0,60: Pre-roll at 0 seconds and repeat every 60 seconds.
        • -1,60: Post-roll at the end and repeat every 60 seconds.
        • 60,0: Repeat every 60 seconds and include a pre-roll.
        • 60,-1: Repeat every 60 seconds and include a post-roll.
      • Invalid combinations: Custom intervals like 10,60 are not allowed.
    • Three Values:
      • Valid combinations include one positive interval with pre-roll and/or post-roll:
        • 0,60,-1: Pre-roll at 0 seconds, repeat every 60 seconds, and post-roll at the end.
        • 60,0,-1: Repeat every 60 seconds, with both pre-roll and post-roll.
      • Invalid combinations: Custom intervals like 10,60,130 are not allowed.

3. Special Cases
  • 0: Pre-roll at the start of the video or live stream.
  • -1: Post-roll at the end of the video or live stream.
  • Any positive number: Specifies the interval at which ads will repeat.

Examples
  • Input: 60
    Ads will repeat every 60 seconds (e.g., 60, 120, 180...). Works for both live streams and VOD.

  • Input: 0,60
    Ads will play at 0 seconds (pre-roll) and repeat every 60 seconds thereafter. Applies to both live and VOD content.

  • Input: 0,60,-1
    Ads will play at 0 seconds (pre-roll), repeat every 60 seconds, and include a post-roll at the end. Suitable for VOD and live streams.


4. User Customization

  • Parameter: usersCanSetTheirOwnVideoAdsVASTURL
  • Description: Allows users to provide their own VAST URLs for video ads.
  • How to Use: Users can set their VAST URL in the "My Account" page.

5. Paid User Exemption


6. Optional Ad Tags

  • Parameters: optionalAdTagUrl1, optionalAdTagUrl2, ..., optionalAdTagUrl10
  • Description: These advanced parameters allow different VAST tags for different apps.
  • Use Case: Only useful for building custom apps with specific ad configurations.
    • Note: These tags are not typically used for the website.

How These Parameters Are Updated

The placeholders in your ad URLs are dynamically replaced with real values. Here’s a table of all placeholders and how they are updated:

Category Placeholder Updated By Description
General Information {ip} Server Viewer’s IP address.
{content_page_url} Server Content page URL (encoded).
Video Information {video_duration} Video Metadata Length of the video.
[VIDEO-TITLE-HERE] Video Metadata Clean video title.
{Category} Video Metadata URL-encoded video category.
{ChannelName} Video Metadata URL-encoded video channel.
Ad Tracking {cb} Server Cache buster value.
[ADS-TRACKING-ID] Server Another cache buster.
{{CACHEBUSTER}} Server Similar to {cb}.
User Information {device_id} Device/Session Viewer’s device ID.
[DEVICE-USER-AGENT] Request Headers URL-encoded user agent.
{os} Device Metadata Operating system.
{Country} Geolocation Viewer’s country (URL-encoded).
{lat} App Request (lat parameter) Latitude sent by the app.
{lon} App Request (lon parameter) Longitude sent by the app.
{u_paln} App Request (u_paln parameter) User plan.
{ifa} App Request (ifa parameter) Identifier for advertisers.
Screen Information {width} Device Metadata Screen width.
[CONTENT-DISPLAY-WIDTH] Device Metadata Alternative for {width}.
{{WIDTH}} Device Metadata Another alternative for {width}.
{height} Device Metadata Screen height.
[CONTENT-DISPLAY-HEIGHT] Device Metadata Alternative for {height}.
{{HEIGHT}} Device Metadata Another alternative for {height}.
Additional Tracking [LIMIT-TRACKING] Configuration Tracking limit (0 or 1).

Ad Performance Reports

Monitor your ads with detailed reports on:

Troubleshooting

If you're not seeing ads, the most common issues are:

1. The Ad Tag is Not Delivering Ads

  • Sometimes, the ad tag you are using may not be providing ads, making it unclear whether the plugin is set up correctly or if the issue is with the ad provider.

How to Test Your Setup

  1. Use a Reliable Test Tag:
    To confirm your setup is working, use the following test ad tag:

    https://vast.forjesus.tv/vast.xml
    

    This tag will always deliver ads, allowing you to verify that everything is configured correctly.

    • If ads appear with this test tag, the plugin is working as expected.
    • If ads still don’t appear, the issue is likely with your plugin configuration.
  2. Check Your Ad Provider:

    • If the test tag works but your own ad tag doesn’t deliver ads:
      • Contact your ad provider.
      • Ask them to check why their tag isn’t delivering ads.

2. Pay-Per-View or Subscription Plugins

  • If you are using the PayPerView or Subscription plugins, they may block ads for users who are subscribed to one of your plans or have purchased content.

How to Test This

  1. Temporarily disable the PayPerView and Subscription plugins.

  2. Check if ads appear after disabling these plugins.

    • If ads start working, the issue is related to one of these plugins.
    • Review the settings in these plugins to ensure they are not blocking ads for your account.

3. Using Multiple Ad Tags

You can add multiple ad tags to ensure ads are always delivered. The plugin will try each tag in order until one works.
Example:

https://vast.forjesus.tv/vast.xml;https://company1.vast.xml;https://company2.vast.xml

In this case:

  • The first tag (https://vast.forjesus.tv/vast.xml) ensures ads are delivered if other tags fail.

Summary

  1. Test with the reliable tag:
    Use https://vast.forjesus.tv/vast.xml to ensure the plugin is working.
  2. Check other plugins:
    Temporarily disable the PayPerView or Subscription plugins to confirm they’re not blocking ads.
  3. Contact your ad provider:
    If the test tag works but your own tag doesn’t, reach out to the provider to resolve the issue.
Clone this wiki locally