TimesApps Introduces Enhanced Campaign Tracking and User Engagement Tools
TimesApps has rolled out a new feature, `toiPlusEvents`, designed to bolster campaign tracking and user engagement across its digital platforms. This update integrates Google Ads (gtag) and Facebook (FB) event tracking, alongside the Survicate customer feedback platform, to provide a more complete understanding of user interactions and campaign performance.
the `toiPlusEvents` functionality dynamically loads tracking scripts based on site configuration and user status. Initially, it checks for `toiplus_site_settings` to determine if Google and Facebook campaigns are active. If these settings are available and the user is not identified as a prime subscriber, the relevant tracking scripts are deployed. This ensures that campaign data is captured from the outset for non-prime users.
In scenarios where the initial site settings are not readily available or if the user is identified as a prime subscriber,the system retrieves updated site settings from a designated Jarvis API endpoint. This dynamic fetching mechanism allows for real-time adjustments to campaign tracking and engagement strategies. The retrieved settings then dictate whether Google Ads and Facebook event tracking should be activated, and crucially, which sections of the website are permitted to deploy Survicate surveys. The selection of Survicate sections is further refined by whether the user is accessing the site via a prime user layout, ensuring a tailored feedback experience.
The integration of Survicate is managed through a conditional loading approach. The `setAttributes` function is responsible for configuring Survicate visitor traits, including user subscription status and geolocation. this function is either called directly if the Survicate JavaScript object (`_sva`) is ready, or it is indeed attached as an event listener to the `SurvicateReady` event.This ensures that Survicate is initialized and configured correctly, regardless of the page’s loading sequence.
the Survicate script itself is dynamically injected into the document’s head. A new script element is created, its source set to the Survicate workspace URL, and then inserted before the first existing script tag in the document. This method ensures that the Survicate script is loaded asynchronously and efficiently.
The `TimesApps.toiPlusEvents` function serves as the central point for initiating these tracking and engagement features. It is designed to be flexible, adapting its behavior based on the availability of configuration data and the user’s subscription status, thereby optimizing the collection of valuable user insights and campaign performance metrics.