Adobe Experience Platform Web Analytics

Simple Object Manager

Hello world,
I am coming back with a new idea for the analytics community and I looking for feedback and help to make a library helper for you.

What is the Simple Object Manager ?

The Simple Object Manager is a JavaScript library that would help on the implementation of the AEP Web SDK and representation of your data in a schema, but not only. It is technically not really focus on the XDM schema structure.
It is mostly a helper to deal with object manipulation.
Because AEP Web SDK (or AEP in general) is expecting an object to be passed, it requires you to deal with an object on the page.
There are JavaScript methods available to manipulate objects (Object, Arrays), but they may not be easy to master and are not consistent depending on the object type.

The idea is to have an easy way the preparation of the data sent to Adobe Analytics is. In Adobe Analytics, you usually use the “s” object to gather different information.
By either adding s.eVar or s.prop, or s.events. That makes it very easy to understand what you are sending.

However, the nature of objects in JavaScript is not that easy to manipulate.
I am trying to bring to the implementation team an easy way to prepare the (XDM) object, and lower the bar of entry for implementing the AEP Web SDK.

Why using Simple Object Manager?

Let’s be honest, I wish I would not come with this kind of library. I do not like writing JavaScript, even worse to make people rely on my own JavaScript library to build things.
However, I am seeing a lot of questions on how to handle AEP Web SDK implementation for websites and no real easy answer for this. You have the AEP Web SDK Extension to create a data element but it is required for you to create other data elements to handle the whole object.

EDDL approach

Your best option would be to push your website development team in order to generate an Event Driven Data Layer (EDDL) and you could just use the object that your developer maintain with the events to push the information to AEP Web SDK.

However, this option is not always possible for your website implementation team, changing the data layer structure can be quite heavy in terms of development work.

Also, it could also be that the website implementation team is willing to use an EDDL, but the data structure of the data layer is not following the schema of your AEP implementation.
That means that you need to manipulate the object received by the EDDL and you better be ready to have some data structure knowledge in order to manipulate that object.

AEP Mapper

For the current Adobe Experience Platform users, they may be familiar with the Mapping capability of Adobe Experience Platform, that is a sort of Processing Rule (on steroids) for modifying object received and transform it or improve it before ingestion in the AEP Data Lake.

However, this option has the limit to only be able to remap certain data structures, or not able to use what has not been tracked in the first place.

If a possibility to map normal object to XDM on server is available in the future, you still need to create the object and this helper tool may be useful.

Limit of the Simple Object Manager

The Simple Object Manager is not meant to replace your data layer implementation but to complement it.
It takes the philosophy of the EDDL logic in order to simplify access and manipulation of the object but do not carry any event related task.

In a typical EDDL logic you can create listener to event and push event to the data layer, this is not the goal of that library, and it will never be. It will not create a history of event related to that object, so you can replay the change if needed.

It also means that it is smaller and do not grow as big on the page, because no history is kept.

Simple Object Mapper presentation

As I explained earlier, this is presented as a JS library that you can download on my github project.

Link: https://github.com/pitchmuc/Simple-Object-Manager

It has an Open-Source license so you can copy and improve that idea if you want for your own organization.
There is a minified and unminified version of the script.
The goal is to keep the minified library very small (<=3k)

Launch Extension

At some point I want to propose a Launch extension, not an extension from the Launch catalog as it is not something I can propose and will be everlasting (except if Adobe takes my initiative and make it official like it did with my ACDL Extension). I may not be in Adobe forever and if my sandbox account is deleted when I leave, there is no telling if the extension attached to that sandbox will survive and who would be able to maintain that.

What I want to propose is the code to generate your own private extension.
It also means that you can extend the extension with your own code or display your own branding term or logo.

Simple Object Manger Instantiation and methods

The Simple Object Manager provides a class called `Som` that can be instantiated with different elements.
You can generate an empty instance of it, but you can also pass an object during instance creation, and you can have a default value to be returned when your getter method is not accessing a field.

The different methods to instantiate are described below:

// assuming that you have loaded the library beforehand

som1 = new Som() // simple

som2 = new Som({'foo':'bar'}) // with an object

myObject = {'foo':'bar'}
som3 = new Som(myObject) // with an object reference

som4 = new Som(defaultvalue='nothing') // with a default value

From there on, there are different methods available.
Briefly, the methods are:

  • get -> retrieve the element value following the path provided, such as “_tenant.foo” (or the all value if nothing is passed)
  • assign -> assign a value to a specific element.
  • remove -> remove the element (and its child) from the path provided.
  • clear -> clear the whole object

You can always access the whole object by accessing the data attribute.
You have a complete documentation on the methods and examples in my github: https://github.com/pitchmuc/Simple-Object-Manager/blob/main/Simple_Object_Manager_Methods.md

But you can also watch the video where I demonstrate the behavior of that library.

Development & Feedback

I may be too optimistic but I believe that this could be helpful and people may be interested to optimize or help me develop the launch extension for such library.

If that is the case, please do not hesitate to comment on the github.
Overall, I received great support from the community for the python libraries that I built over the year, I am pretty sure that some people may be interested in that small project.

At the end, it has limited amount of methods so it can stay small and we would need a limited amount of support to maintain it.

Leave a Reply

Your email address will not be published. Required fields are marked *