Git Product home page Git Product logo

adobe-analytics-di's Introduction

adobe-analytics-di

TrackingImage

Adobe Analytics Data Insertion Module

This node module allows you to push data into your Adobe Analytics reporting suite from the server side. It uses the Data Insertion API to push your data into your reporting suite.

Installation

npm install adobe-analytics-di --save

Example

Setup the Analytics DI API:

var adobeAnalyticsHelper = require('adobe-analytics-di');
adobeAnalyticsHelper.setReportingSuiteId("MY-REPORTING-SUITE-ID");

Send data to Adobe Analytics. Note that the property names are case sensitive because they get used in the XML sent to the DI API:

var callData = {
      visitorID: 'myvisitorId',
      pageName: 'My Home Page',
      channel: 'My Channel name',
      eVar10: 'test evar10 value',
      prop10: 'test prop10 value',
      events: "event10,event11"
    };

var myDi = adobeAnalyticsHelper.getDataInsertion(callData);

if (myDi != null) {
    adobeAnalyticsHelper.sendCallToAdobeAnalytics(myDi);
}

Tests

npm test

Release History

  • 1.0.0 Initial release
  • 1.0.1 Added missing dependency
  • 1.0.2 Updated the README
  • 1.0.3 Updated the README to remove the html formatting from the code section
  • 1.0.4 Updated the keywords
  • 1.1.0 added logging feature
  • 1.2.0 now with 100% more promises
  • 1.2.1 Fix for referrer being overwritten with ReportingSuiteId
  • 1.3.0 Added fixes from Radu and updated testing from Make to use Mocha
  • 1.3.1 Updated to support the latest Insertion API spec. Zoran added the required 'imsregion' property.
  • 1.3.2 Added getters and setters. Thanks to DhrBaksteen for the contribution
  • 1.3.4 Added setter for setting DI service port. Thanks to kevpmoore for the contribution. Also I have updated the default tracking server as suggested in https://github.com/AdobeAtAdobe/adobe-analytics-di/issues/
  • 1.3.6 Updated dependencies, #20 Incorrect validation of mandatory visitorId, #19 pageName shouldn't always be mandatory, #18 Broken Docs Link in Readme

adobe-analytics-di's People

Contributors

davidbenge avatar dbenge avatar dependabot[bot] avatar dhrbaksteen avatar filmaj avatar kevpmoore avatar rluncasu avatar shazron avatar znikolovski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

adobe-analytics-di's Issues

update version

update version number and publish new version to NPM
Also update README to show the version change.

pageName shouldn't always be mandatory

The library currently makes pageName mandatory. However, as the XML API spec states:

to specify that a given row should be considered a page view, that row must contain either pageName or pageURL. To specify that a given row should be considered a link event, that row must include linkType and either linkName or linkURL. If a given row contains both linkType and either pageName or pageURL, Adobe Analytics will automatically clear out pageName and pageURL by setting them to null.

We are using the library purely for link event tracking, so we don't need to pass pageView and yet the library forces us. As it is if we somehow end up with an accidentally undefined linkName the lib will fall back to using the pageName value.

The validation should be smart enough to handle these scenarios.

New npm release 1.0.5

Thanks for pulling in #6!
Is it possible to bump the patch version 1.0.5 (or even a minor version 1.1.0 since it has a new feature), and publish to npm?

Thanks!

Incorrect validation of mandatory visitorId

This code enforces that either ip or visitor is defined and throws an error if both are undefined.

This is incorrect. As per the AA docs, marketingCloudVisitorID is a valid visitor identification method.

Errors should not be thrown if the marketingCloudVisitorID is defined.

Suppress console output

I would like to send a PR for this feature, but discussing it here first.

function _sendCallToAdobeAnalytics(di){

We are using this library in a command line context, so we need to suppress any console.* calls. I'm thinking of either overriding this call with an extra boolean parameter (to suppress), or optionally pass in an object that is to be used instead of console (this object will have log and error as exported functions).

The intent of this change would be that the existing behaviour will not change if that extra parameter is not set. What do you think?

Library should default to RDC collection instead of 2o7.net collection

This library uses xyz.112.2o7.net as the default collection server (as opposed to xzy.sc.omtrdc.net), which means it's using the old configuration and is not Regional Data Collection (RDC) enabled. Sure, this can be overridden using the "setTrackingServerUrl" method to use an RDC endpoint, but sensible defaults should be used, rather than old legacy defaults.

There are many customers who had not transitioned to RDC, but wanted to implement server-side-forwarding using server-side Adobe Analytics. They had a lot of problems with it, especially, many unsuccessful calls. They transitioned to RDC and all these problems went away.

contextData should accept JSON properties

As it stands, the contextData property forces the developer to provide values as XML, like this:

var callData = { pageName: 'analytics-di-test', visitorID: 'myvisitorId123123123123', contextData: '<sc_contextDataTest>my context data test</sc_contextDataTest>' };

It is very confusing for a Node library to ask developers to provide XML strings. JSON is the object notation for JavaScript and it should be the library's job to convert a developer's context data JSON object into the required XML string that the AA API expects, instead of putting this burden on the developer.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.