getCode

Get an action tracing point tag. An action tracing point tag is usually put on the advertiser's website to track user behavior after contact with an ad.

Request format

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

objectID*

The ID of the object that the action is performed on.

* Required

Response format

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

Response parameters

name1

Ad code loader: Parameter name.

code1

Code loader: Added to the head of the website page.

name2

Tracing point ad tag (https): Parameter name.

code2

Action tracing point ad tag.

name3

Link to action tracing point: Parameter name.

code3

Link to action tracing 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 code loader</name1>
  <code1>&lt;!--Add code loader to the &lt;head&gt; of the website 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>Tracing point ad tag (https):</name2>
  <code2>&lt;!--AdFox START--&gt;
&lt;!--yandex_example--&gt;
&lt;!--Advertiser: advertiser_example--&gt;
&lt;!--Action tracing 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 action tracing point</name3>
  <code3>https://yandex.com/ads/adfox/123456/tracePoint?p7=wtvn&amp;p8=b</code3>
</result>
</response>

Other actions with the object

See also other actions with the tracingPoint object:

Previous
Next