-
Notifications
You must be signed in to change notification settings - Fork 979
GoogleAds_IMA Videos Ads on your page
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.
- Follow the service's approval process.
- Upon approval, you will receive a publisher ID for live video ads.
- Ensure all instances of
adtest=on
are removed for ads to function in a live environment.
- For help with the AdSense setup process, refer to their tutorial here.
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.
-
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 (
;
).
-
Parameter:
adTagUrlForKids
- Description: Used for videos marked as "made for kids."
- Configuration: Provide a separate URL tailored for kid-safe 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.
-
Start:
-
Parameter:
start
- Description: Enables ads at the start of the video.
-
Parameter:
-
25% Progress:
-
Parameter:
mid25Percent
- Description: Plays ads when 25% of the video is watched.
-
Parameter:
-
50% Progress:
-
Parameter:
mid50Percent
- Description: Plays ads when 50% of the video is watched.
-
Parameter:
-
75% Progress:
-
Parameter:
mid75Percent
- Description: Plays ads when 75% of the video is watched.
-
Parameter:
-
End:
-
Parameter:
end
- Description: Enables ads at the end of the video.
-
Parameter:
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:
- 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.
-
Example:
- Important: If more than 4 times are specified, ads will play only at these specific moments and will not repeat at regular 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...).
-
Example:
-
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.
- Valid formats specify pre-roll or post-roll combined with an interval:
-
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.
- Valid combinations include one positive interval with pre-roll and/or post-roll:
-
Single Value:
-
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.
-
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.
-
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.
-
Parameter:
doNotShowAdsForPaidUsers
- Description: Prevents ads from being shown to paid users.
- How to Use: Works with plugins like:
-
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.
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). |
Monitor your ads with detailed reports on:
- Impressions
- Click-through rates
- Skipped ads
Refer to the Ad Performance Report Tutorial.
-
Check your ad provider:
- Ensure no restrictions or issues exist with your provider.
-
Test your configuration:
- Use this test VAST tag to verify setup:
https://vast.forjesus.tv/vast.xml
- This feed always returns an ad. If it works but other providers fail, the issue lies with those providers.
- Use this test VAST tag to verify setup:
-
Using Multiple VAST Feeds:
- Configure multiple feeds for fallback using semicolons (
;
). Example:https://vast.forjesus.tv/vast.xml;https://company1.vast.xml;https://company2.vast.xml
- The first feed ensures ads are always delivered.
- Configure multiple feeds for fallback using semicolons (