<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://nielsentest.mywikis.net/w/index.php?action=history&amp;feed=atom&amp;title=trackViewability</id>
	<title>trackViewability - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://nielsentest.mywikis.net/w/index.php?action=history&amp;feed=atom&amp;title=trackViewability"/>
	<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=trackViewability&amp;action=history"/>
	<updated>2026-04-08T19:32:02Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.5</generator>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=trackViewability&amp;diff=6001&amp;oldid=prev</id>
		<title>NickParrucci: Created page with &quot;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|iOS SDK API Reference}}  {{CurrentBreadcrumb}} Category:Digital Category:iOS SDK API Reference  Viewability support...&quot;</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=trackViewability&amp;diff=6001&amp;oldid=prev"/>
		<updated>2022-10-05T20:50:22Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|iOS SDK API Reference}}  {{CurrentBreadcrumb}} &lt;a href=&quot;/wiki/Category:Digital&quot; title=&quot;Category:Digital&quot;&gt;Category:Digital&lt;/a&gt; &lt;a href=&quot;/wiki/Category:iOS_SDK_API_Reference&quot; class=&quot;mw-redirect&quot; title=&quot;Category:iOS SDK API Reference&quot;&gt;Category:iOS SDK API Reference&lt;/a&gt;  Viewability support...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|iOS SDK API Reference}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
[[Category:iOS SDK API Reference]]&lt;br /&gt;
&lt;br /&gt;
Viewability support requires additional parameters to be provided from player applications to the SDK. In order to provide those parameters and to start the viewability measurement &amp;lt;code&amp;gt;trackViewability&amp;lt;/code&amp;gt; method is added to the public SDK API.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Objective C'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
- (void)trackViewability:(nonnull NSDictionary *)data;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Swift'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
func trackViewability(_ data: [String : Any])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Calling trackViewability for player view ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Objective C'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
NSString *targetViewTag = targetView.tag;&lt;br /&gt;
NSString *controlsViewTag = controlsViewTag.tag;&lt;br /&gt;
NSString *activityIndicatorViewTag = activityIndicatorView.tag;&lt;br /&gt;
NSDictionary *viewabilityData = @{@&amp;quot;viewTag&amp;quot;: targetViewTag,&lt;br /&gt;
                                  @&amp;quot;viewContainer&amp;quot;: targetView.window,&lt;br /&gt;
                                  @&amp;quot;friendlyObstructions&amp;quot;: @[controlsViewTag, activityIndicatorViewTag]};&lt;br /&gt;
[sdkInstance trackViewability:viewabilityData];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Swift'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
let targetViewTag = targetView.tag&lt;br /&gt;
let controlsViewTag = controlsViewTag.tag&lt;br /&gt;
let activityIndicatorViewTag = activityIndicatorView.tag&lt;br /&gt;
let viewabilityData: [String:Any] = [&amp;quot;viewTag&amp;quot;: &amp;quot;\(targetViewTag)&amp;quot;,&lt;br /&gt;
                                     &amp;quot;viewContainer&amp;quot;: targetView.window!,&lt;br /&gt;
                                     &amp;quot;friendlyObstructions&amp;quot;: [&amp;quot;\(controlsViewTag)&amp;quot;, &amp;quot;\(activityIndicatorViewTag)&amp;quot;]]&lt;br /&gt;
sdkInstance.trackViewability(viewabilityData)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Input Parameters ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Description&lt;br /&gt;
|-&lt;br /&gt;
| data || NSDictionary object with the following objects and keys:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| viewTag (mandatory) || value of NSNumber type, unique identifier (tag) for the target view object. This tag can be assigned for the player view either programmatically or in the storyboard/xib.&lt;br /&gt;
|-&lt;br /&gt;
| viewContainer (mandatory) || pointer to the parent view object. It is needed to identify the concrete scene in the applications which support multiple scenes. This parameter can not be nil.&lt;br /&gt;
|-&lt;br /&gt;
| friendlyObstructions (nullable) || an array of tags of the views which should be ignored during the intersection ratio calculation. Those are views like loading activity indicator, player controls, view with a watermark, etc. which are displayed in front of the target view, but should not reduce the viewability intersection ratio. The tags of such should be wrapped into the NSNumber objects before adding into the array. This parameter is nullable, empty array is also accepted.&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;br /&gt;
[[File:PlayerView FirendlyView(Timer &amp;amp; Slider).png|300px]]&lt;br /&gt;
&lt;br /&gt;
== Output Parameters ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Output Parameters (Return value) !! Description&lt;br /&gt;
|-&lt;br /&gt;
| Void ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
If incorrect view tag is provided, SDK will not be able to measure viewability metrics. Viewability engine tries to find a view for the provided tag during 15 seconds and if it is not found it goes to inactive state. In order to restart the viewability engine it is required to call trackViewability with a proper tag again.&lt;/div&gt;</summary>
		<author><name>NickParrucci</name></author>
	</entry>
</feed>