ViewLift Macros
  • 18 Dec 2023
  • 6 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

ViewLift Macros

  • Dark
    Light
  • PDF

Article summary

About AdTag Macros in ViewLift

A macro is a predefined code that is used to insert dynamic values into a program. In the context of ads, a macro is a predefined code that is used to insert dynamic values into an ad tag. For example, the "lat" macro dynamically populates the user's latitude into the ad tag. This enables advertisers to target ads more effectively by providing them with dynamic information about the user, such as their location, device type, or other factors.

The ViewLift Player supports a number of ad macros that can be added to your VAST tag URL. The ViewLift macros are formatted as a query string that can be used to pass values to the endpoint on the frontend (ViewLift Player). When a video ad is requested on the ViewLift Player, ViewLift will pass in the macro/variable tags to the VAST tag.

For example, if you want to target ads based on the user's location, you could use the following macros:

ads.lat=37.7749
ads.lon=-122.4194

In this example, ads.lat macro is being used to insert the value 37.7749 into the ad tag. This value will be replaced with the user's latitude when the ad is served.

You can pass Viewlift macros in AdTag URLs, content URLs, and other places, such as the header of a web page or in the HTML code of a video player. In content URLs, you can pass the values via SSAI using SCTE markers. SSAI is a technique for inserting ads into video content without having to make changes to the video player. This can be useful for live broadcasts, where it is not possible to make changes to the video player. 

Here's an example code block for an original m3u8 file URL before replacing macros: 

"https://example-cloudfront.net/v1/master/placeholder/master_placeholder/index.m3u8?ads.iu=/placeholder/placeholder/placeholder/appletv&ads.w=VIEWLIFT_WIDTH&ads.h=VIEWLIFT_HEIGHT&ads.size=VIEWLIFT_SIZE&ads.ua=VIEWLIFT_USER_AGENT&ads.app_id=TBDv1&ads.did=VIEWLIFT_DEVICE_ID&ads.device_make=VIEWLIFT_DEVICE_MAKE&ads.pp=OTT&ads.vl_paln=VIEWLIFT_PALN&ads.vl_ppid=VIEWLIFT_PPID&ads.idtype=tvOS&ads.us_privacy=VIEWLIFT_US_PRIVACY&ads.ic=VIEWLIFT_IAB&ads.gdpr=VIEWLIFT_GDPR&ads.consent=VIEWLIFT_CONSENT&ads.lat=VIEWLIFT_LAT&ads.lon=VIEWLIFT_LON&ads.dnt=VIEWLIFT_DNT&ads.ip=VIEWLIFT_IP&ads.coppa=VIEWLIFT_COPPA&ads.ipadd=VIEWLIFT_IP"

The original URL includes placeholder values for various parameters. These placeholders are intended to be replaced dynamically when the video is played. 

ViewLift AdTag macros for MRSS Feed content

Prerequisites

  • You have generated an MRSS feed that contains information about your media files, including the location of the ad breaks.
  • You have configured your ad-serving platform to fetch and parse the MRSS feed and set up the targeting criteria for your ads.

About MRSS Feed

An MRSS feed is a file that contains information about the media files, including the location of the ad breaks. It does not contain the actual ads themselves. The ads are served by an ad server, which is a separate system that is responsible for delivering ads to websites and other channels.

When a user plays a video that is included in an MRSS feed, the player will first request the MRSS feed from the server. The server will then return the MRSS feed, which the player will parse to get the information about the media files, including the location of the ad breaks. The player will then request the media files from the server. The server will then return the media files, and the player will play them.

If the MRSS feed includes information about ad breaks, the player will insert the ads into the video at the specified locations. The ads will be served by the ad server, which will select the appropriate ads for the user based on a variety of factors, such as the user's location, interests, and demographics.

Here's a list of ViewLift AdTag macros that you can populate dynamically to your AdTag URL. 

Supply tag query parameterVIEWLIFT PARAM NAMEMacro descriptionExample macro values
w=VIEWLIFT_WIDTHWidth of the ViewLift Player300
h=VIEWLIFT_HEIGHTHeight of the ViewLift Player250
size=VIEWLIFT_SIZESize of the player (SpotX only)S
Size is parsed into dimensions that are passed to demand tags.
domain=VIEWLIFT_DOMAINPage Domainweather.com
url=VIEWLIFT_URL Page URL"https://weather.com/weather/radar
/interactive/1/1037891:5:US"

This passes the full page URL on the demand tag.
encoded_url=VIEWLIFT_ENCODED_URLEncoded page URL

"http%3A%2F%2Fwww.weather.com% 2Fweather%2Fradar %2Finteractive%2F1%2F1037891%3A5% 3AUS"

double_encoded_url=VIEWLIFT_DOUBLE_ENCODED_URLDouble-encoded page URL"http%253A%252F%252Fwww.weather.com% 252Fweather %252Fradar%252Finteractive%252F1% 252F1037891 %253A5%253AUS"
cb=VIEWLIFT_CACHEBUSTERRandom number to prevent caching by the browser.3708662946268
ts=VIEWLIFT_TIMESTAMPSave content with UNIX timestamp1589919931
ts_ms=VIEWLIFT_TIMESTAMP_MSUNIX timestamp w/ milliseconds1589919931035
ip=VIEWLIFT_IPUser IP address52.52.52.52

IP address is used for geotargeting. SpringServe will detect if the macro is excluded from exported supply tag.
ua=VIEWLIFT_USER_AGENTUser-agent stringMozilla/5.0 (iPhone; CPU iPhone OS 6 0 like Mac OS X) AppleWebkit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25

User-agent used for device and operating system. SpringServe will detect if the macro is excluded from exported supply tag.
lat=VIEWLIFT_LATUser latitude33.543682 
lon=VIEWLIFT_LON User longitude-86.779633 
dnt=VIEWLIFT_DNTDo not track0 or 1

dnt 1 = true and essentially means to opt-out of advertisements
desc=VIEWLIFT_DESCRIPTIONVideo descriptionIAB19
ic=VIEWLIFT_IABIAB Category ID of site contentIAB19
dur=VIEWLIFT_DURATIONVideo duration length in seconds15
min dur=VIEWLIFT_MIN_DURATIONMinimum duration in seconds5
max_dur=VIEWLIFT_MAX_DURATIONMaximum duration30
ap=VIEWLIFT_AUTOPLAY1 if player set to autoplay, 0 if not0 or 1
ad_pos=VIEWLIFT_AD_POSPosition of ad1
Position of the ad relative to other ads on the page. ex. 1 for first, 2 for second etc.
mute=VIEWLIFT_MUTEIs player muted1 (muted)
0 (not muted)
device_make=VIEWLIFT_DEVICE_MAKEDevice brand Samsung, Apple
device_model=VIEWLIFT_DEVICE_MODELDevice ModelGalaxy, F8332
os=VIEWLIFT_OSOperating SystemIOS, Android, Linux, Windows, etc.
os_ver=VIEWLIFT_OS_VERVersion of the Operating System70.0.3538.110
isp=VIEWLIFT_ISPInternet Service Providercomcast
app_bundleVIEWLIFT_APP_BUNDLEApp bundle591560124, com.pic.photoeditor
app_name=VIEWLIFT_APP_NAMEApp namephotoeditor
app_store_url=VIEWLIFT_APP_STORE_URLApp store URL

https://play.google.com/store/apps/details?id=com.pic.photoeditor&hl=en_US

did=VIEWLIFT_DEVICE_IDThis macro should be replaced with the respective device ID when a user plays a stream URL on any platform.
437825ef-a4a6-4575-8b70-81630c6d76e5
kwds=VIEWLIFT_KEYWORDSKeywordsComma-separated list of keywords associated with the ad request.
mid=VIEWLIFT_MEDIA_IDMedia id1234
vt=VIEWLIFT_ENCODED_VIDEO_TITLEEncoded video titlemy%20video%20content
vid=VIEWLIFT_VIDEO_IDUnique identifier for the video content12345
v_urlVIEWLIFT_VIDEO_URLEncoded video urlhttps%3A%2F%2Fmy video content.mp4
consent=VIEWLIFT_CONSENTA consent string passed from various Consent Management Platforms (CMP's)TBD

Mandatory for all European traffic for GDPR.
gdpr=VIEWLIFT_GDPRA flag for European Union traffic consenting to advertise1 (true, consenting) or 0 (false, non-consenting)

Mandatory for all European traffic for GDPR.
us_privacy=VIEWLIFT_US_PRIVACYA mandatory string for all publishers in which they must pass the privacy consent for users from CaliforniaViewLift fills in "1YNN" value in the default case and if user opts out of Email Consent, then the value is passed as "1YYN".
This setting is configured on AppleTV, IOS, Web, Android app and TV, Roku, and FireTV.

Other values: "1NYN"    or    "1-Y-"    or    "1---"  where the N character means No, Y= Yes, - = Not Applicable)

Mandatory for all traffic from California.
coppa=

VIEWLIFT_COPPA

A flag indicating traffic that is subject to the Children's Online Privacy Protection Act1 (true) or 0 (false)

This is a pass-through macro that must be set by the supply partner on the top-level supply tag.
brand_name=VIEWLIFT_BRAND_NAMEConnected TV brandsSamsung, Apple TV, Vizio

SpringServe will detect if the macro is excluded from exported supply tag.
ctv_ad_dur_ms=VIEWLIFT_CONTENT_DURATION_MSUsed as a demand tag macro. Will multiply CREATIVE_DURATION by 1000

This is for demand tags that require duration in milliseconds instead of seconds.


ctv_ad_dur=VIEWLIFT_CONTENT_DURATIONUsed as a demand tag macro. Duration of the mediafile0:00:07
prod_max_dur=

VIEWLIFT_MAX_POD_DURATION

Used to set the maximum duration of an ad pod in seconds90

Optional - if blank, the default duration is 300 seconds. Could also use the UI to create custom settings.
ctv_ad_dur_ms=VIEWLIFT_MAX_POD_DURATION_MSUsed as a demand tag macro. Will multiply pod_max_dur by 100090000

This is for demand tags that require duration in milliseconds instead of seconds.
content id=VIEWLIFT_CONTENT_IDID for "content" object for PC and SSHB bid requests (see OpenRTB 2.5)24!vch192b7
content_episode=VIEWLIFT_CONTENT_EPISODEEpisode for "content" object for PC and SSHB bid requests (see OpenRTB 2.5)11
content_title=VIEWLIFT_CONTENT_TITLETitle for "content" object for PC and SSHB bid requests (see OpenRTB 2.5)A%20New%20Hope
content series=VIEWLIFT_CONTENT_SERIES_TITLE"Content Series" in the context of PC and SSHB bid requests pertains to the categorization of content into thematic series, and it allows advertisers to make informed decisions about which ads to display based on the type of content being consumed by users.

“The Office” (television), “Star Wars” (movie), or “Arby ‘N’ The Chief” (made for web).

content_season=VIEWLIFT_CONTENT_SEASONContent season5
content_genre= VIEWLIFT_CONTENT_GENREGenre for "content" object for PC and SSHB bid requests (see OpenRTB 2.5)Comedy
app_id=VIEWLIFT_APP_IDApp store id is a 6 or 10-digit numeric number - mainly applicable to Apple591560124


Populate macros on third-party feeds

If you are ingesting content as a third-party feed and like ViewLift to populate macros as part of feed ingestion you can also do that as follows. If you are uploading content to ViewLift directly, you can skip this step.

To create a feed with customized macros:

  1. Enable Macros checkbox on feed creation view.
  2. Check the necessary macros.
  3. Update Query Parameters if it does not fit the endpoint.

Users can also check and enable/disable macros for existing feeds by clicking the Check Macros button.

Notes
  • You can add macros only when if the feed input is Video/Episodic.
  • You cannot edit macros for the existing feed.
  • Categories and tags are directly picked from video metadata added in the CMS. These can't be overridden using macros.

Was this article helpful?