Creating Adobe Launch Extension : Data Element Module

This article will focus on how to create Data Element modules. It is an important component of the Adobe Launch solution and it can help your end user a lot if they require very specific type of data.

Data Elements in Launch

Data Elements in Launch are a “kind of” data layer for your Launch implementation. They are representing a layer of information that is (normally) not present on your website.

Normally, you should already have a data layer available on your website, that would help you define precise information for your analytics tool or your pixel tracking (Google Display Network, Facebook, etc…).

Sometimes the information you want to transmit to your partner or to your solution is not available from the data layer directly. It means that you need to use custom code for retrieving the information.

You can do the custom code directly in the action of your rule, by coding the script there. However, if you are going to re-use this piece of information, if it is a relevant information for other partners / solutions. You may want to capture it in a Data Element in order to easily re-use them later on.

Creating Data Elements

Creating a Data Element is quite easy in Launch and the tool provides a lot of predefined possibility for your Data Elements.
I will list the more common ones but a lot are already provided.

  • Cookie Value
  • DOM Attribute
  • JavaScript variable
  • Local Storage
  • Session Storage
  • Query String parameter
  • Page Info : URL / Hostname / Pathname / Referrer / Title…

As you can see, there are already a lot of possible way to retrieve information from the website that are easily available from the UI. However it may come that you would need to use the custom code to retrieve a more precise information, or transform a cookie value into a more clean value.

In our case we will create 2 Data Elements, just to prove that we are not bind to create one element by Extension and how that impact the different elements.

I won’t be very creative here as we are going to create way to retrieve local or session storage and retrieving hash (#) parameters. The storage options already exist in the UI interface, I just chose them for the sake on showing how it would look like.

Data Element HTML

I will post only the HTML and JavaScript for the sessionStorage Data Element. The files are going to be mostly similar for the localStorage version.

The HTML is normally located in src>View>my_session_storage.html

Data Element JavaScript

Below you can find the script to retrieve a localStorage value :

On top of that, I develop a script to retrieve parameter coming after any type of parameter (?, #), depending your setting on the global extension :

I think that the Data Element module is the easiest module to understand. I hope I didn’t confuse you on it and you’ll get a sense of what is possible from this module.

On this series, you may want to look at those articles :

ArticleContent
Introdcution to Adobe Launch & Extension Creation This posts covers the basic of what you need to know in order to start with this series of articles.
Architecture and dependencies within modules This posts covers the architectures and how the different modules are linked between each others
Global Extension Configuration This article explains how to set up your configuration HTML file. It is the core configuration module of your extension.
Event type module This article will show you how to build an event module. Every module will have a configuration part (HTML) and wrapper(JS).
Condition module
This article will show you how to build a condition module.
Action module This post will be related to the action module and how to build it. We will also see how you can actually import some cool feature of the launch library.
Data Element moduleThis article will be developing the possibilities of the Data Element module
Shared moduleThis article will focus on the shared functionality that you can write and share with other extension developpers to used. We will also used a feature shared from Adobe Analytics to show you how to use it.
Other featuresThe other features that are related to Launch Extension. I will cover additional (and important) information there.
Testing your extensionHow do I debug my Extension ?
Releasing and updating your ExtensionHow do I publish my Extension into Launch ? And after, how do you update it ?

Leave a Reply

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