Steps to implement Adobe Analytics data insertion API using POST

Determining Domain

In most cases, using [NAMESPACE].sc.omtrdc.net is sufficient. Replace [NAMESPACE] with your Adobe Analytics login company with all spaces removed. Some examples:

mylogincompany.sc.omtrdc.net
example.sc.omtrdc.net

You can technically use whatever namespace you'd like, however it is highly recommended to be specific to meet the following criteria:

  • No other Adobe Experience Cloud customers would use it
  • You are consistent with the subdomain across all report suites.

Alternatively, you can use first-party domains if you have implemented CNAME redirects to omtrdc.net in your organization:

stats.example.com

Built the Data Insertion URL

The data insertion API should look as follow for default RDC:

http://[NAMESPACE].[TRACKING SERVRER]/b/ss//6

The data insertion API should look as follow for CNAME that resolves to RDC

http://[CNAME TRACKING SERVER]/b/ss//6

IMPORTANT

  • It is important that you respect the syntax above.
  • Do not put the Report Suite ID in the URL put it in the XML

Visitor ID

It is important that you provide a unique ID for each visitor. If you provide the same visitor ID then you will only get one unique visitor in Adobe Analytics and all conversion event and eVar allocation will be incorrect.

For Visitor Identification the following 5 types are used in Adobe Analytics. s_vi and AMCV are the one 99% of implementation are using:

Order Used Query Parameter (collection method) post_visid_type column value Present When
1 vid (s.visitorID) 0 s.visitorID is set.
2 aid (s_vi cookie) 3 Visitor had an existing s_vi cookie before you deployed the Visitor ID service, or you have a Visitor ID grace period configured.
3 mid (AMCV_ cookie set by Marketing Cloud Visitor ID service) 5 Visitor's browser accepts cookies (first-party), and the Marketing Cloud Visitor ID service is deployed.
4 fid (fallback cookie on H.25.3 or newer, or AppMeasurement for JavaScript) 4 Visitor's browser accepts cookies (first-party).
5 HTTP Mobile Subscriber header 2 Device is recognized as a mobile device.
6 IP Address, User Agent, Gateway IP Address 1 Visitor's browser does not accept cookies.

Check the timestamp status of your report suite

Each report suite in Adobe Analytics can have one of these 3 timestamp settings:

Timestamp required : the report suite will only accept hits that have a manual timestamp send with the hits

Timestamp not allowed: the report suite will only accept hits that do not have any manual timestamp in the hits. If a manual timestamp is present the hit will be filtered out from reporting

Timestamp optional: both manually timestamped hits and non-timestamped hits will be accepted.

To check your report suite settings got to Admin > Report Suites > Edit Settings > General > Timestamp Configuration

At present it is necessary to be really careful with timestamp optional as explained here

This official doc for:

Sequential Data requirements

HTTP 1.1

 

XML encoding and Supported XML tags

XML data sent to the data insertion API must be in UTF-8 and the special XML characters need to be replaced with entities. Some examples

You can find all supported XML tags here

curl example

HTTP 1.0

curl -X POST -A "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.112 Safari/534.30" -H "Content-Type: text/xml" --http1.0 -v -d @event.xml http://alexis.d1.sc.omtrdc.net/b/ss//6

HTTP 1.1

curl -X POST -A "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.112 Safari/534.30" -H "Content-Type: text/xml" --http1.1 -v -d @event.xml http://alexis.d1.sc.omtrdc.net/b/ss//6

Event.xml file

<?xml version=1.0 encoding=UTF-8?>
<request>
    <sc_xml_ver>1.0</sc_xml_ver>
    <events>event5</events>
    <pageURL>testVideo.html</pageURL>
    <pageName>Video CURL</pageName>
    <visitorID>videoUSERID1</visitorID>
    <contextData>
        <a>
            <contentType>Video API</contentType>
            <media>
                <channel></channel>
                <name>VIDEO API</name>
                <playerName>VIDEO API Player</playerName>
                <length>96.711111</length>
                <timePlayed>23</timePlayed>
                <segmentNum>4</segmentNum>
                <segment>M:75-100-API</segment>
                <segmentView>true</segmentView>
                <complete>true</complete>
            </media>
        </a>
    </contextData>
    <linkType>m_i</linkType>
    <timestamp>1432642867</timestamp> >
    <reportSuiteID>lscsalexisandrdoidvideotest</reportSuiteID>
</request>

Notes:

  • Always specify a valid User-Agent.
  • Never use the default one of CURL
  • Always specify a pageName and pageURL
  • Checkthe timestamp settings of report suite
  • Check which Visitor ID needs to be used

Check the following documentation for POST response codes

Additional resources

Šis darbs ir licencēts saskaņā ar Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported licenci  Uz portālā Twitter™ un Facebook izvietotajiem ziņojumiem neattiecas Creative Commons sistēmas noteikumi.

Juridisks paziņojums   |   Tiešsaistes konfidencialitātes politika