Macros with REPLACEMENTS.

This article describes replacements functionality and explains with what custom parameters and how it can be used.

Macros with Replacements allows to pass parameters from the supply to demand.
Macros and Replacements can also be used to gather data to the Aniview reporting system via the usage of Custom Dimensions(Core Settings | Custom Params).

Example use case

The client is sending AV_CONTENT_TITLE, AV_TITLE or content_title in parallel depending on request, but want to group all of the values in the reporting under one custom dimension. (There may be few reasons why to send the same data under different parameters like different versions of the client’s software or other client-related specific use cases).
Most of the times it happens due to old integrations.

It is better to use the original macro such as AV_CONTENT_TITLE

In the above case the Replacements(which are the available macros) will have the following structure:

AV_CONTENT_TITLE = query_parameter.AV_TITLE or query_parameter.AV_CONTENT_TITLE or query_parameter.content_title

The above example means that [AV_CONTENT_TITLE] macro will be resolve from AV_TITLE= or AV_CONTENT_TITLE= or content_title=
From the query string of the serving request.

  1. AV_TITLE
    https://ssai.aniview.com/api/v1/hls/vod.m3u8?cb=[RANDOM_NUMBER]&AV_WIDTH=1920&AV_HEIGHT=1080&AV_PUBLISHERID=6061b03d7c1c3439e71d2d6b&AV_CHANNELID=64ccb1915489593c8907edc4&AVS_SSAIID=65c0c81b0cb51a9f1c0ef624&AVS_SOURCE=[M3U8_MEDIA_URL]&AVS_STREAM_TYPE=VOD&AV_TITLE=Game+of+Thrones&AV_CATEGORY=[IAB_CAT]&AV_USERAGENT=[USER_AGENT]

  2. AV_CONTENT_TITLE
    https://ssai.aniview.com/api/v1/hls/vod.m3u8?cb=[RANDOM_NUMBER]&AV_WIDTH=1920&AV_HEIGHT=1080&AV_PUBLISHERID=6061b03d7c1c3439e71d2d6b&AV_CHANNELID=64ccb1915489593c8907edc4&AVS_SSAIID=65c0c81b0cb51a9f1c0ef624&AVS_SOURCE=[M3U8_MEDIA_URL]&AVS_STREAM_TYPE=VOD&AVS_STREAM_FORMAT=HLS&AVS_TEMPLATE=WEB&AVS_ADSERVER_RESPONSE_TYPE=VAST&AVS_NOMARK=true&AVS_PREFETCH=false&AVS_DEDUP=0&ssai=1&AV_URL=lgchannels.com&AV_APPNAME=[APP_NAME]&AV_IDFA=[DID]&ip=[MY_IP]&AV_CDIM1=01&AV_CDIM2=N21&AV_APPPKGNAME=[APP_BUNDLE]&AV_DNT=0&AV_CONTENT_TITLE=Thor+Ragnarok&AV_CATEGORY=[IAB_CAT]&AV_USERAGENT=[USER_AGENT]&AV_RANDOM=[RANDOM_NUMBER]&AV_CONTENT_SERIES=[LG_SERIES_TITLE]&AVS_PASS_MARKERS=true

  3. content_title
    https://ssai.aniview.com/api/v1/hls/vod.m3u8?cb=[RANDOM_NUMBER]&AV_WIDTH=1920&AV_HEIGHT=1080&AV_PUBLISHERID=6061b03d7c1c3439e71d2d6b&AV_CHANNELID=64ccb1915489593c8907edc4&AVS_SSAIID=65c0c81b0cb51a9f1c0ef624&AVS_SOURCE=[M3U8_MEDIA_URL]&AVS_STREAM_TYPE=VOD&AVS_STREAM_FORMAT=HLS&AVS_TEMPLATE=WEB&AVS_ADSERVER_RESPONSE_TYPE=VAST&AVS_NOMARK=true&AVS_PREFETCH=false&AVS_DEDUP=0&ssai=1&AV_URL=lgchannels.com&AV_APPNAME=[APP_NAME]&AV_IDFA=[DID]&ip=[MY_IP]&AV_CDIM1=01&AV_CDIM2=N21&AV_APPPKGNAME=[APP_BUNDLE]&AV_DNT=0&content_title=Ronin&AV_CATEGORY=[IAB_CAT]&AV_USERAGENT=[USER_AGENT]&AV_RANDOM=[RANDOM_NUMBER]&AV_CONTENT_SERIES=[LG_SERIES_TITLE]&AVS_PASS_MARKERS=true

Example report with above parameters:

image-20240613-182328.png

List of Macros with REPLACEMENTS

We have 5 special custom parameters AV_CUSTOM17 - AV_CUSTOM21, that knows how to resolve data from the resolved REPLACEMENTS.

You can add custom parameters in Account Settings > CUstom Parameters or use the instruction below: Core Settings | Custom Params.