Dynamize Picture

Once created driven by our AdServer, images change based on established parameters ( Geolocation, weather, date/time, cookies, retargeting …).

To dynamize pictures you have 2 methods at your service :

addImage

The addImage function allows you to insert an <img> tag inside a container.

ADventori.Display.addImage(element, data, urlDefault, dontTrackError);

This function needs four parameters:

  • element: The targeted element where the <img> tag will be inserted.
  • data: The data that will be sent in this element.
  • urlDefault: optional. The default URL in case the first URL inside data doesn’t exist.
  • dontTrackError: optional. If equal to “true”, this method don’t send error when there is a problem with image source.

Don’t forget to add some css to resize your picture.

Example


addBgImage

The addBgImage function allows you Insert a background image inside a HTML container after checking that the image source is valid.

ADventori.Display.addBgImage(element, data, urlDefault, dontTrackError);

This function needs three parameters:

  • element: The targeted element which on the background-image will be set.
  • data: The data that will be sent in this element.
  • urlDefault: optional. The default URL in case the first URL inside data doesn’t exist.
  • dontTrackError: optional. If equal to “true”, this method don’t send error when there is a problem with image source.

Example


If you dynamize an <img> tag , You have to remove the src attribute.