getCode

Get an action point tag. An action point tag is usually placed on the advertiser's site to track user behavior after their exposure to an ad.

Request format

https://adfox.yandex.com/api/v1
  ? object=tracingPoint
  & action=getCode
  & objectID=<integer>

objectID*

ID of the object the action applies to.

Response format

<response>
<status>
  <code>{integer}</code>
</status>
<result>
  <name1>{string}</name1>
  <code1>{string}</code1>
  <name2>{string}</name2>
  <code2>{string}</code2>
  <name3>{string}</name3>
  <code3>{string}</code3>
</result>
</response>

Response parameters

code

Request processing status. A value of 0 means the request was completed successfully. For the key, see Error handling.

name1

Ad loader code: Parameter name.

code1

The loader code is embedded in the head of the site page.

name2

Action point tag (https): Parameter name.

code2

Action tracking point tag.

name3

Link to an action tracking point: Parameter name.

code3

Link to an action tracking point.

Sample request and response

Request:

https://adfox.yandex.com/api/v1?object=tracingPoint&action=getCode&objectID=3

Response:

<response>
<status>
  <code>0</code>
</status>
<result>
  <name1>Ad loader code</name1>
  <code1>&lt;!--Add the loader code to the site's &lt;head&gt; once --&gt;
&lt;script&gt;window.yaContextCb = window.yaContextCb || []&lt;/script&gt;
&lt;script src="https://yandex.com/ads/system/context.js" async&gt;&lt;/script&gt;</code1>
  <name2>Action tracking point tag (https):</name2>
  <code2>&lt;!--AdFox START--&gt;
&lt;!--yandex_example--&gt;
&lt;!--Advertiser: advertiser_example--&gt;
&lt;!--Action tracking point: ATP_Ex--&gt;
&lt;div id="adfox_123456789987654321"&gt;&lt;/div&gt;
&lt;script&gt;
window.yaContextCb.push(()=&gt;{
        window.Ya.adfoxCode.tracePoint({
            ownerId: 123456,
            containerId: 'adfox_123456789987654321',
            params:{
                p7: 'wtvn',
                p8: 'b'
            }
        })
    })
&lt;/script&gt;
&lt;!--AdFox END--&gt;</code2>
  <name3>Link to an action tracking point</name3>
  <code3>https://yandex.com/ads/adfox/123456/tracePoint?p7=wtvn&amp;p8=b</code3>
</result>
</response>

Other actions with the object

Read about other actions with the tracingPoint object:

ID of the object the action applies to.

Required parameter.

Previous
Next