Provides the ability to access and render an ad.

The ads object allows you to select a specific ad or ad placement:

<div>
{% assign ad = ads["Ad Name"] %}
<h4>{{ ad.title }}</h4>
<a href="{{ ad.redirect_url }}">
<img src="{{ ad.image.url }}" alt="{{ ad.image.alternate_text }}" />
</a>
</div>

Ads Attributes

placements

Returns the adplacements object.

[ad name or id]

You can access any ad by its Name or Id properties.

{% assign ad = ads["Ad Name"] %}

{% assign ad = ads["da8b8a92-2ee6-476f-8a21-782b047ff460"] %}

Ad Placements Attributes

[ad placement name or id]

You can access any adplacement by its Name or Id properties.

{% assign placement = ads.placements["Placement Name or Id"] %}

{% assign placement = ads.placements["2423d713-abb3-44c3-8a7d-c445e16fccad"] %}

Ad Placement Attributes

ads

Returns the collection of ad objects associated with the placement.

Iteration tags and array filters may be used with this collection.

name

Returns the Name field for the ad placement.

placement_url

The URL that can be used to retrieve the ad placement fully rendered by a template.

random_url

The URL that can be used to retrieve a random ad from the placement fully rendered by a template.

ad_url

The URL that can be used to retrieve the ad fully rendered by a template.

copy

Returns the Copy field for the ad.

image

Returns the image object (if any) for the ad.

name

Returns the Name field for the ad.

open_in_new_window

Returns true if the url specified by redirect_url should open in a new window.

redirect_url

The URL that the user will be directed to by clicking on the ad.

Ad Image Attributes

alternate_text

Return the text that is intended to appear in the tag's alt attribute.

height

Returns the height in pixels for the image

url

Returns the url source for the image.

width

Returns the width in pixels for the image