How to integrate
Novatiq enables buyers to access audiences of their choice in real-time, using the network verified Hyper ID to enable addressability.
The Hyper ID is an anonymous, unique and transient ad request ‘label’ that is generated by the buy-side and delivered to the buyer via the RTB bid request.
A sync request must be made from the user device, using either the Novatiq Hyper ID sub module in prebid.js, JavaScript or Android and iOS code for applications.
This consists of generating a random UUID (Hyper ID) and making a GET API request to https://spadsync.com sending the Hyper ID to Novatiq.
The Hyper ID primes the Novatiq solution so that audiences are ready to be received by the buy-side’s backend.
Sample Prebid.js, JavaScript, Android and iOS code for this function can be found in the Appendix.
In parallel to the sync call the publisher needs to ensure that the Hyper ID is included in the ad request that is distributed to the buy-side.
Novatiq will provision a Fusion account, including consumOR, and provide the endpoint and credential ID for buy-side API queries.
Once the Hyper ID has been received by the buy-side advertising platform(s) an API call to the Novatiq ConsumOR needs to be made.
Sample API call code for this function can be found in the Appendix.
The ConsumOR will return any audience IDs that the user is part of and that have been requested by the buy-side for a campaign.
To ensure Novatiq bills the buy-side, accurately the buy-side partner needs to provide Novatiq with near real-time audience usage reports – i.e. impressions delivered using a Hyper ID audience.
A report may be either CSV or json format and should be delivered to a Novatiq Amazon S3 bucket/input folder from between every 5 mins to every hour. Each report file should include:
Audience usage report fields:
| Hyper ID | Novatiq Hyper ID associated to the bid request. If no Hyper ID (ID match) then use 1 of the additional identifiers |
|---|---|
| Timestamp | Timestamp associated to the bid request, indicating when this bid request was received and processed, up to the millisecond. The timestamp is in UTC 0 and the format is yyyy-mm-ddTHH:MM:SS.msZ |
| Exchange/SSP | Exchange or supply-side-platform which generated the bid request (optional) |
| Inventory price | Price paid by the buy-side for the ad space impression (optional). The value is a decimal in USD as currency |
| Data price | Blank (Deprecated. Novatiq audience pricing is used) |
| Buy-side campaign identifier | Campaign identifier within a buy side. It is provided by the buy side. This piece of information is used to provide further details when running the billing process and generating detailed invoices in a per campaign basis |
| Segments | Audience (segment) codes used by the buy side to win the bid request. When more than 1 audience was used these must be enclosed in double quotes and separated by commas.
Note: The audience codes provided *must* only refer to the winning campaign for a delivered impression, and not the audience codes for all matching campaigns as delivered in the consumOR query response |
| IntFlag | When data was matched from Hyper ID set to 0 When data was matched from additional IDs set to 2 |
| BidRequestID | the bID and the impression ID for the bid request in the format <BidID>:<ImpresionID> |
Sample WinLog code for this function can be found in the Appendix.
Novatiq will supply the S3 bucket name and access credentials for reporting when the buy-side registers as a partner.
Novatiq Fusion is a web UI for audience creation and campaign activation, including edit, pause, re-start and extension. It can be utilised as a UI interface accessed from within the buy-side environment or provisioned as an API into the buy-side UI.
If using the Novatiq UI, access is granted by Novatiq provisioning an admin user within the buy-side who can then provision additional users to create and manage audiences and campaigns as needed.
If using the Fusion API integration to the buy-side platform for audience and campaign management via the buy-side interface a rest API is used.
Creating audiences and launching campaigns via the web UI or API, results in campaign specific audience codes being generated and made available in the expanded campaign dashboard.
The 11 digit audience codes appear, in brackets, under the audience name, e.g. “10000000611”. and must be either copied and pasted into the corresponding campaigns in the buy-side campaign management platform or will be automatically added if a full API integration is in place.
To understand more about Fusion please email laura.brennan@novatiq.com for a comprehensive demo.
const hyperID = generateUUID();
const sspid = 'your-assigned-code';
const ssphost = window.location.hostname;
const url = `https://spadsync.com/sync?sptoken=${hyperID}&sspid=${sspid}&ssphost=${ssphost}`;
fetch(url)
.then(response => {
if (response.status === 200) {
console.log("Call was successful.");
} else if (response.status === 204) {
console.log("Call was not successful. User is offnet.");
} else {
console.log(`Unexpected response status: ${response.status}`);
}
})
.catch(error => {
console.error('Error making the request:', error);
});
function generateUUID() {
var uuidFormat = [1e7] + -1e3 + -4e3 + -8e3 + -1e11 + 1e3;
return (uuidFormat).replace(/[018]/g, c => {
return (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
}
);
}
First, add the OkHttp dependency to your ‘build.gradle’ file:
dependencies {implementation 'com.squareup.okhttp3:okhttp:4.9.1'}
Then use this Java code structure:
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import java.io.IOException;
public class SyncRequest {
private static final String HYPER_ID = UUID.randomUUID().toString();
private static final String SSP_ID = "your-Novatiq-assigned-code";
private static final String APP_NAME = "your-app-name";
public static void main(String[] args) {
OkHttpClient client = new OkHttpClient();
String url = "https://spadsync.com/sync?sptoken=" + HYPER_ID + "&sspid=" + SSP_ID + "&ssphost=" + APP_NAME;
Request request = new Request.Builder()
.url(url)
.build();
try (Response response = client.newCall(request).execute()) {
if (response.isSuccessful()) {
if (response.code() == 200) {
System.out.println("Call was successful.");
} else if (response.code() == 204) {
System.out.println("Call was not successful. User is offnet.");
}
} else {
System.out.println("Unexpected response status: " + response.code());
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
import Foundation
let sspid = "your-assigned-code"
let ssphost = "your-app-name"
let tmpUuid1:String = UUID.init().uuidString
let tmpUuid2 = UUID.init().uuidString.split(separator: "-")
let hyperID = tmpUuid1 + tmpUuid2[3]
let urlString = "https://spadsync.com/sync?sptoken=\(hyperID)&sspid=\(sspid)&ssphost=\(ssphost)"
if let url = URL(string: urlString) {
var request = URLRequest(url: url)
request.httpMethod = "GET"
let task = URLSession.shared.dataTask(with: request) { data, response, error in
if let httpResponse = response as? HTTPURLResponse {
switch httpResponse.statusCode {
case 200:
print("Call was successful.")
case 204:
print("Call was not successful. User is offnet.")
default:
print("Unexpected response status: \(httpResponse.statusCode)")
}
} else if let error = error {
print("Error making the request: \(error)")
}
}
task.resume()
}
The ConsumOR call must be made from your backend. If you are using a non node.js backend please contact Novatiq raj.sidhu@novatiq.com.
(using the Fetch API and within a function)
async function fetchSegments(region, dataPartnerId, hyperId, altId) {
const url = `https://${region}.consumor.io/segments/v1/${dataPartnerId}/${hyperId}/${altId}?v=2`;
try {
const response = await fetch(url);
if (response.status === 404) {
console.log("No segments found");
} else if (response.status === 200) {
const data = await response.json();
console.log("Segments:", data);
} else {
console.log("Unexpected status code:", response.status);
}
} catch (error) {
console.error("Error fetching segments:", error);
}
}
// Example usage
const region = "";
const dataPartnerId = "";
const hyperId = "";
const altId = "";
fetchSegments(region, dataPartnerId, hyperId, altId);
This is the Novatiq preferred format.
When using the json format, each json formatted record is appended to the current WinLog file as a single line (no line breaks within the json).
An example json WinLog:
{ "hyperid": "566844cd-19b8-431c-be57-55363431fe4b6094", "timestamp": "2016-12-02T00:03:23.85061Z", "exchange_ssp": "BidSwitch", "dspcampid": "dsp_camp_id_123", "segments": ["10000000001","10000000002", "10000000003"], "intflag": "0", "bidrequestid": "E9811C02F4C1F02649D1E3F68E60DCC4:6-970-342" }
Note: It is recognised that the overall file will not be json syntax compliant, but each row within the file will be.
In CSV format, each audience usage record is a single comma-separated row in the file.
Example:
566844cd-19b8-431c-be57-55363431fe4b6094,"2016-12-02T00:03:23.85061Z“,BidSwitch,dsp_camp_id_123,”10000000001,10000000002,10000000003”,0,E9811C02F4C1F02649D1E3F68E60DCC4:6-970-342