Tracking integration via Single Line of Code


Measuring user behavior agile with a Javascript line Tracking integration via single Line of Code

20.10.2020 author /
Dr. Marco Krause / Rayk Richter*
/ Stephan Augsten

The online presence of every company is a central customer interface. This makes tracking integration, which can be implemented via single line of code, all the more important. What does a corresponding implementation look like?

Company about the topic

With just one line of JavaScript code, deep user tracking can be implemented.With just one line of JavaScript code, deep user tracking can be implemented.

(Image: T-Systems Multimedia Solutions)

Whether online shop, Internet portal or intranet: For every type of digital company appearance, it is recommended to maintain the usability of the websites at a permanently high level and to be able to better understand the use of the processes by the users. The collection of usage data for the evaluation and control of the website design is therefore essential.

This process of data collection can be optimized by a novel method of implementation. This makes the collection of usage data on websites particularly fast and flexible. At the same time, data collection is bundled, modelled and controlled within a central tool.

Apart from the initial insertion of a single JavaScript line of code, no adjustments or maintenance of the tracking in the website code are required, allowing for release-independent data collection. Special tools are used in the analysis area.

What does “Single Line of Code” mean and how does it work?

With just one line of JavaScript code, deep user tracking can be implemented.With just one line of JavaScript code, deep user tracking can be implemented.

(Image: T-Systems Multimedia Solutions)

Behind “Single Line of Code” lies a fundamentally tool-independent integration approach of tracking websites, single-page apps, communities and intranets. In this approach, only a JavaScript code line is integrated into the source code of the page. This line of code is henceforth to be understood as a dynamic library, through which the tracking modeled in a tag management tool is loaded and the data is subsequently provided via it.

In addition to tracking, some tools such as Mapp Intelligence also offer a dashboard engine for precise data evaluation. Through this approach, every tracking functionality can be carried out decentrally, without adjustments to the source code and without an additional release of the page, modeled in the tag management system and controlled its live progress.

What can be measured by this approach?

Thanks to this new integration approach, all aspects of website use can be easily measured and mapped in a uniform data structure. These include, among other things, the following aspects:

Page Tracking

  • measuring the number of page views: How often is my website accessed?
  • measuring a user’s scroll depth on all pages: How far do visitors to my website scroll? Will content be seen at the bottom of the page?
  • measuring the number of 404 page views: Did the visitor come to the 404 page from an external feed or via a clickable element on the website? Where is the faulty URL that redirects to this 404 page?

Action tracking

  • measuring the number of clicks on interaction elements (e.g. teasers, buttons, images, text elements): How often are my onsite campaigns clicked? How are my navigation elements used?
  • measuring user interactions with form fields in form lines: Here, a distinction can be made between processed, unfilled and error-producing form fields (mandatory fields that cause a reload of the page when filled out incorrectly): Which form fields are overlooked by the users and thus damage the usability? Which form fields are most often filled out incorrectly?
  • Form field-based user segmentation: How many women or men start a process? Which of my target groups completes a website process most frequently or least?

Search Tracking

  • measuring and mapping of internal search processes: How often is the search function used by users? Which search phrases are used most often? Which search phrases do not provide search results?

Video tracking

  • measuring interactions with video content: Which videos are watched most often until the end? Which videos are canceled most often after startup?

Process and e-commerce tracking

  • the detailed measurement of Website-processes and applications different complexity (logins, contact requests, registrations, downloads, different application routes): How often are my website processes started and completed? Where do users cancel most often?
  • the illustration of an e-commerce process on various pages, for user segmentation and monetized conversion rate evaluation, both in e-commerce and non-e-commerce contexts: How much revenue did I generate from a particular product? How many newsletter registrations and/or registrations could I generate and what monetary value do they represent for my company?
  • measuring and distinguishing error pages in form lines: After a wrong input into a form field, a reload of a form page occurs. This page receives a separate identifier, which makes it distinguishable from the previous (same) page: which pages of my form section or my shopping cart process make it most difficult for my visitors to complete? How can you make the process easier to minimize the hurdles to conversion?


  • Control of data protection-relevant tracking elements (e.g. Consent banners): The approach provides the opportunity to react quickly and independently to socio-political changes and influences.

What are the benefits?

Through the” Single Line of Code approach”, an above-average transparency of the use of different types of digital channels can be established, which is narrower, faster and better. The centralized bundling of tracking modeling in the Tag Management System creates a centrally controlled and uniform data structure that is independent of any adjustments in the source code of the page.

Using this method, the collected data remains comparable and the risk of integrating heterogeneous tracking approaches in the source code and the associated inconsistencies of the data is excluded. In this way, a valid basis for the Interpretation of the data and the resulting derivation is created of optimization measures on the Website.

In addition, there are also procedural advantages with regard to the initial tracking integration as well as the extension of an existing tracking. This saves developer resources. These only need to schedule and integrate a single line of code for the tracking topic. As a result, communication channels between the development and the tracking team are saved and efficiently designed, as well as long waiting times for implementation and bug fixing are reduced.

In addition, the process of tracking integration and adaptation becomes narrower, faster and less susceptible to any integration errors that may affect the performance of the site by bundling and uniformly locating the tracking topic among the tracking experts.

Complex tracking test procedures are also avoided in this way. The tests can be carried out directly on the live system. At the same time, adjustments and bug fixes do not require major work loops and coordination between development and tracking outstaffing experts.

Overall, the “Single Line of Code approach” is an agile way of integrating tracking extensions. These can be modeled, tested and immediately given live via an existing tag management system, regardless of applicable release cycles.

Dr. Marco Krause is Advanced Consultant Digital Intelligence and Rayk Richter is Technical Consultant Digital Intelligence at T-Systems Multimedia Solutions GmbH.


Ready to see us in action:

More To Explore
Enable registration in settings - general
Have any project in mind?

Contact us: