All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.7.0 - 2024-11-14
- Added new client event
amp:banner:mutated
.
- Banners are now tracked by MutationObserver to be able to send metric events from cloned banners, or close banners with buttons that were added after rendering.
1.6.1 - 2024-10-11
- Added support for banners closing.
- HTML banners can be simply closed via any element with a data attribute
data-amp-banner-close=""
. - Added the ability to rename events and their parameters using the
metrics.events
andmetrics.params
options. Parameters can also be overwritten for each event separately. - Added the ability to add custom extra parameters for all events using the
metrics.extraParams
option or for each event separately.
- Changed arguments that are passed to the listeners
amp:banner:attached
,amp:banner:state-changed
,amp:fetch:error
andamp:fetch:success
. Arguments are now passed as an object, so instead of(banner) => {}
it is necessary to write({ banner }) => {}
, respectively({ response }) => {}
in case of eventsamp:fetch:error
andamp:fetch:success
. - Moved
dimensions
field from thepositionData
to the content object of typeimg
according to changes in AMP v2.16.0 API changes. - Updated docs.
- Removed the
metrics.disabledEvents
option. Events can now be disabled by puttingfalse
next to the event name in themetrics.events
option.
1.6.0 - 2024-09-19
- Added support for new banner option
fetchpriority
. - Added support for banner options defined in the AMP administration.
- Updated docs.
- Deprecated the option
loading-offset
. The optionloading
is now processed as an expression.
1.5.0 - 2024-04-04
- Added
embed
mode for banners rendering. Embed banners are rendered in iframes and can be enabled via data attributedata-amp-mode="embed"
. - Added a new JS client for use in iframes. It is not intended for direct use on a website.
- Added the property
AMPClientFactory.version
that returns the package version in semver format. - Added attributes
width
andheight
for images if a dimensions are returned by the API.
- The package has been refactored from CommonJS to ESM.
- Updated dependencies.
- The property
version
on the client now returns an object of typeClientVersion
instead of a simple semver string. - Updated docs.
1.4.0 - 2023-12-14
- Added property
version
in the client. - Added integration with server-side rendered banners.
- Added ability to provide custom options for each banner. Options can be passed via data attributes
data-amp-option-<optionName>="<optionValue>"
and can be retrieved in event handlers. - Added support for native lazy loading. Feature can be enabled through banner options
loading=lazy
andloading-offset=<offset>
(for multiple positions only).
- Property
banner.data
is now deprecated. To access information about a position use propertybanner.positionData
. For example, replacebanner.data.displayType
withbanner.positionData.displayType
. - The default templates have been modified and moved to the
./src/template
directory. - Updated docs.
1.3.1 - 2023-10-25
- Fixed issue with unicode characters when creating banner fingerprint.
1.3.0 - 2023-10-24
- Added new optional configuration option
origin
that is used as a value for the headerX-Amp-Origin
.
- Changed the default templates - images are now rendered inside
<picture>
with<source>
tags inside if the API returns data for them.
1.2.1 - 2023-10-25
- Fixed issue with unicode characters when creating banner fingerprint.
1.2.0 - 2023-08-14
- Added support for watching interactions with banners (intersection in the viewport and clicks) and metrics.
- Added new configuration options for interaction:
interaction.defaultIntersectionRatio
interaction.intersectionRatioMap
interaction.firstTimeSeenTimeout
- Added new configuration options for metrics:
metrics.receiver
metrics.disabledEvents
- Added new client events:
amp:banner:intersection-changed
amp:banner:first-time-seen
amp:banner:first-time-fully-seen
amp:banner:link-clicked
- Added automatically sending of metrics events:
amp:banner:loaded
amp:banner:displayed
amp:banner:fully-displayed
amp:banner:clicked
- Added preconfigured receivers for handling metrics events:
debug
plausible
gtag
gtm
- Updated integration guide.
1.1.0 - 2023-01-04
- Added the client option
method
with accepted valuesGET
andPOST
, the default value isGET
. - The client is now is able to communicate with API via both methods.
- Added the CHANGELOG.
- Added the section
Versions compatibility matrix
in theIntegration Guide
.
- Updated the table of the client options in the
Integration Guide
.
1.0.10 - 2021-10-31
- Replaced usage of function
Array.includes()
withArray.indexOf()
.
1.0.9 - 2021-05-21
- Updated the default templates for banners (opening links in the new window allowed).
- Added
Integration Guide
into the README.
- Added missing getter
Banner.resources
.