Pixel server

Home / Pixel server
To collect events from a website (linked to the online behaviour) the only requirement is that every page on that website should contain a Single Line of Javascript Code. Since Javascript is only executable in web browsers and some related applications, different methods are required to connect a different data source to a DimML application

The alternative that is provided is the request of a URL. Typically an application that can connect to the internet can also perform a GET request on an URL. For instance a Native App can connect with the internet to get the latest data to use in the app. This also means a request to a DimML application can be made.

The biggest limitation to this method compared to connecting to a website with a SLOC is that the DimML application cannot provide instructions back. The data flow is a one way street from source to DimML application. That means that all the data that needs to be collect from the source needs to be placed into the URL request. This needs to be done by the owner of the data source who needs to implement the URL request and the parameters in the URL for specific cases.

The URL looks like this:

This will request a 1×1 transparant image, a pixel, which can be ignored. To connect to a development environment, the environment ID can be added to after image and before .gif. Furthermore all data that needs to be send can be added as query parameter. There is no limit to the amount of parameters that can be added, but the total URL length of 2KB needs to be taken into account. It is recommended to directly link to a concept in the DimML application. When doing this the URI of the concept should be used. For example if the environment plem contains a file o2mc.io.dimml with the concept nativeapp, the concept id is /plem/nativeapp. If for example a native app should send a screen name and the screen id, the URL request would look like this if the environment is plem
As with all DimML requests and SLOC executions, this call depends on the URL request to load from a certain domain. In the example this means the script is executed from www.o2mc.io. If the URL is requested by a script, not located at www.o2mc.io, no data will be available to the DimML application.

To circumvent this, it is possible to add the domain of the DimML application (the name of the DimML file) to the URL request. This is done as followed:

The following DimML code will be able to receive the pixel requests and output the data to the console. As you can see, no vals need to be defined, every parameter that is provided in the pixel request is available as field in each flow.
concept Global {
  match '*'

  @groovy
  flow
  => code [view = '1']
  => console
  => out
}