A simple framework for firing MediaMath Pixels
The SDK has four static reporting functions:
report(advertiser: Int, pixel: Int, addlParams: String?)
report(advertiser: String, pixel: String, addlParams: String?)
report(advertiser: Int, pixel: Int, addlParams: [String: String])
report(advertiser: String, pixel: String, addlParams: [String: String])
advertiser: TerminalOne Advertiser ID (value from
&mt_adid=of a JS pixel from a website)
pixel: TerminalOne Pixel ID (value from
&mt_id=of a JS pixel from a website)
addlParams: Additional information to send to TerminalOne at the time of pixel fire (see 'The addlParams argment')
addlParams may be passed in as a
[String: String] dictionary or as a URL-encoded string of parameters joined by ampersand characters (e.g.
"v1=data1&v2=data2&s1=data3") It may be omitted from function calls if not needed. Advertisers typically use these in scenarios such as the following:
addlParams may be used in the following ways:
- Revenue tracking: To send a pixel tracking the value of an order, include something like
- Deterministic reinforcement: include a
- The value for the mt_exem (for hashed emails, 'email@example.com') or the mt_excl (for hashed account ids, e.g. 'john2015', '829852', etc) must be SHA-256 hashed at the time of pixel firing
- When using
addlParams: [String: String], the value of
mt_exclis automatically hashed. The value of
mt_exemis hashed if it contains an '@' character (i.e. if it is an email address)
- When using
addlParams: String, hashing is not performed by the MediaMath Pixel SDK. The app developer must SHA-256 hash the value.
- For more information, see the API docs on mobile pixels.
- For more information on additional parameters, consule the Knowledge Base.
There is a
setDebugOutput(debug: Bool) function for enabling the printing of debug output to console.
Check out the
MMPixelExampleApp for a simple implementation of the framework.