Configuration

API Key

For the correct setup, the Qt Digital Advertising user needs to provide an API Key.

The API Key is an alpha-numeric string token that the plugin user receives after the completed registration process.

It is used to identify the user and fetch parameters required to play the advertisements and monetize the application.

The API Key should be provided via qdaApiKey property of Config Components.

We would recommend to setup the API Key before advertisement components are created (e.g. EmbeddedAd).

Note: If you don't have your API Key, contact us.

Config Components

Config components are used to provide QML API that allows to specify Qt Digital Advertising configuration parameters (e.g. API Key).

MobileConfig{} is used for configuring ads for Desktop device applications as well as Mobile device applications. Following snippet is an example of a mobile config component:

import QtDigitalAdvertising 1.1

MobileConfig
{
    id: qdaConfig
    qdaApiKey: "paste-your-api-key-here"
    networkId: "4147"
    siteId: "492520"
    appName: "ExampleApp"
    bundleId: "com.example.org"
}

MobileAd {
    width: 320;
    height: 250
    playMode: QtDigitalAdvertising.AutoPlay
    displayMode: QtDigitalAdvertising.Loop
    pageId: "1515277"
    formatId: "104693"
}

Following snippet is an example of a Desktop config component:

import QtDigitalAdvertising 1.1

MobileConfig
{
    id: qdaConfig
    qdaApiKey: "paste-your-api-key-here"
    networkId: "4147"
    siteId: "492520"
        adDomainUrl: "https://yourdomain.com/ads.html"
    appName: "ExampleApp"
    bundleId: "com.example.org"
}

MobileAd {
    width: 320;
    height: 250
    playMode: QtDigitalAdvertising.AutoPlay
    displayMode: QtDigitalAdvertising.Loop
    pageId: "1515277"
    formatId: "104693"
}

Here adDomainUrl needs to be set to your own domain URL where ad configuration files that are received from sales team are kept. For more info, please refer Desktop device applications section.

Note: Qt Digital Advertising plugin for desktop supports MP4 file format only if the required proprietary audio and video codecs, such as H.264 and MPEG layer-3 (MP3), have been enabled. For more details see documentation.

Also, please see EmbeddedConfig QML Type or MobileConfig QML Type.

Ads Properties

Advertisement parameters can be optionally reconfigured by creating adsproperties.ini file and deploying it in a search paths.

This file should contain ad properties in the JSON format, e.g.:

{
  "Adv_1": {
        "configFileLocation":"C:/someLocation/",
        "venueId":"MyVenue",
        "deviceId":"MyId_1",
        "orderId":"MyOrder",
        "supportedVideoFormats":"x-flvx-flv,webm,quicktime,mpg,mpeg,mp4",
        "supportedImageFormats":"jpeg,png",
        "longitude":-73.9925458,
        "latitude":40.7450898
  },
  "Adv_2": {
        "venueId":"MyVenue",
        "deviceId":"MyId_1",
        "orderId":"MyOrder"

  },
  "Adv_3": {
        "venueId":"MyVenue",
        "supportedVideoFormats":"x-flvx-flv,webm,quicktime,mpg,mpeg,mp4",
        "supportedImageFormats":"jpeg,png"
  }
}

The plugin QML property “adPropertiesId” indicates which object from adsproperties.ini will be used for configuration and the default parameters will be overridden by the ones provided in the ini file.

The parameters which can be overridden:

configFileLocation : string
deviceId : string
latitude : double
longitude : double
orderId : string
supportedApplicationFormats : string
supportedAudioFormats : string
supportedImageFormats : string
supportedVideoFormats : string
venueId : string

Search Paths

Configuration files are searched for in various paths.

Following list presents search paths order:

  1. Property configFileLocation (if exists and is set up).
  2. Qt Resource System (i.e. :/).
  3. Directory that contains the application executable (i.e. QCoreApplication::applicationDirPath()).

When a configuration file exists under any of the previously mentioned paths, the search is complete and any remaining paths are ignored.

© 2023 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.