In continuation to my previous blog that discussed on successful web analytics product selection through a use case, in this blog, I have listed methods to implement web analytics independent of the source code.
A typical issue of a solution engineer is such: the implementation of my web analytics tool is embedded in the source code. In order to scale-up to the latest technological developments in the market, I want to switch to another tool. But that would mean that I need to re-do implementation from scratch, which would involve cost and operational overheads. How do I overcome this issue? The answer lies in making implementation of the tool product agnostic, which involves creating a toolkit framework outside the source code. The toolkit framework delivers specific benefits including:
a) Separation of measurement tags from the application code
b) Structured tagging approach which enhances the ease of use and re-usability
c) Vendor agnostic tags to minimize dependency
Tool kit framework approach
This framework can pick up the implementation changes from a text or property file and then insert all these changes into the source files at runtime. To insert the changes we intend to use some sort of framework being supported by EventBus software, wherein the implementation is event driven.
Plugins can be written in the platform service interface specific to the product, wherein the service would use tag component array. Configuration array can be handled at the initiation. Additionally, the query service can be created to make calls to the platform and integration layer, which in turn will publish data to the analytics store. The toolkit framework can use digital management context, which would read from the tag component library and insert analytics to the Document Object Model created dynamically.
JQuery can be used to build this event driven toolkit framework. JQuery supports this cause with loads of methods to handle events like:
- bind() – This method attaches event handlers to the elements
- blur() – This method attaches and triggers the blur events
- change() – This method attaches and triggers the change events
- click() – This method attaches/triggers the click event
- delegate() – This method attaches a handler to current or future specified child elements
- event.currentTarget() – The current DOM element within the event bubbling phase
- event.data() – Contains the optional data passed to an event method when the current executing handler is bound
- event.delegateTarget() – Returns the element where the currently-called jQuery event handler was attached
- event.namespace() – Returns the namespace specified when the event was triggered etc.
All these contribute to build a robust toolkit framework to help inject analytics dynamically on the source code library.
The goal obviously is to let the marketing team responsible for strategizing to concentrate on identifying what kind of tagging is needed and what kind of data needs to be captured on the different types of events. They just need to create a text based file, such as an Excel sheet, and feed it to the toolkit, which will read the file, build the tag component array and start doing the insertion.
There could be multiple ways of going about this, the toolkit framework approach being just one method. Do let us know on your experience during the journey to web analytics adoption. Please feel free to pose any follow-up questions that you may have.