Full Example

The following is a full example of the implementation of the IntentIQ Agent in a webpage –

<html>
<head>
    ...
    <script src="https://PartnersCDN.com/IIQUniversalID.js"></script>
    ...
    <script>
    // Defining prebid config delay
    // Optimal value -> RTT to an IIQ server, for example 500ms
    var maximumPrebidDelayTimeout = 500;
    // Prebid initialization flag to avoid reconfiguring
    var isPrebidInited = false;

    var iiqCallbackMethod = function (eids) {
        if (isPrebidInited === false) {
            //-----------Start prebid configuration-----------
            // Put all prebid configuration in here
            ...
            pbjs.que.push(function () {
                pbjs.setConfig({
                    ....
                });
            });
            isPrebidInited = true;
            //-----------End prebid configuration -----
        }
        // use eids received as you see fit,
        // For example, for sending back to your server
    }

    var pbjs = pbjs || {};
    pbjs.que = pbjs.que || [];
    const intentIq_1234567 = new IntentIqObject({
        partner: 1234567,
        pbjs: pbjs,
        callback: iiqCallbackMethod,
        timeoutInMillis: maximumPrebidDelayTimeout,
        ABTestingConfigurationSource: 'percentage',
        abPercentage: 95,
        manualWinReportEnabled: true,
    });
    ...
    // once you have the winning auction details available, report it using the
    // SDK reporting module
    intentIq_1234567.reportExternalWin({YOUR WINNING DATA});
    </script>
</head>

<body>
    ...
    ...
    ...
</body>
</html>

Last updated