AI-generated Key Takeaways
-
This documentation details the
CompanionAd
interface, which represents a companion ad in the Interactive Media Ads SDK. -
The
CompanionAd
interface offers methods to retrieve information about a companion ad, including itsad slot ID
,HTML content
, andcontent type
. -
You can determine the dimensions of the companion ad using the
getHeight
andgetWidth
methods, both returning values in pixels. -
The
getAdSlotId
function returns the corresponding id for the companion ad, which can be a string or null. -
The
getContent
function returns the HTML content of the ad, and thegetContentType
function returns the content type, which can also be null.
Methods | |
---|---|
get
|
Returns the ad slot id for this companion. |
get
|
Returns the HTML content for the companion ad that can be added to the publisher
page.
|
get
|
Returns the content type of the Companion Ad. |
get
|
Returns the height of the companion in pixels. |
get
|
Returns the width of the companion in pixels. |
Methods
getAdSlotId
getAdSlotId(): string
Returns | |
---|---|
string
|
The ad slot id for this companion. |
getContent
getContent(): string
Returns | |
---|---|
string
|
The HTML content. |
getContentType
getContentType(): string
Returns | |
---|---|
string
|
The content type of the Companion Ad. This may return null if the content type is not known (such as in the case of a VAST HTMLResource or IFrameResource). |
getHeight
getHeight(): number
Returns | |
---|---|
number
|
The height of the companion in pixels. |
getWidth
getWidth(): number
Returns | |
---|---|
number
|
The width of the companion in pixels. |