TimesApps Integrates Enhanced Campaign Tracking and User Engagement Tools
TimesApps has rolled out a new integration designed to bolster its campaign tracking and user engagement capabilities. The update introduces functionalities for loading Google Ads (gtag) events and Facebook (FB) Pixel events, alongside the integration of the Survicate customer feedback platform.
The implementation of these tools is contingent on specific site settings and user subscription status. The system checks for the availability of `toiplus_site_settings`, specifically `isFBCampaignActive` and `isGoogleCampaignActive`. If these settings are present and the user is not a prime subscriber, the google and Facebook tracking scripts are loaded directly.
In scenarios where the initial site settings are not readily available or the user is a prime subscriber, the system fetches these configurations from a remote source. A request is made to `https://jarvis.indiatimes.com/v1/feeds/toi_plus/site_settings/643526e21443833f0c454615?db_env=published`. The response from this endpoint dictates whether the Google and Facebook tracking scripts are activated, and also determines the sections for which Survicate surveys will be enabled, adapting based on whether the user is experiencing a prime user layout.
The Survicate integration is designed to capture user feedback and engagement data.it includes a mechanism to set visitor traits, such as user subscription status and geolocation. The script ensures that Survicate is initialized correctly, either by directly calling its `setVisitorTraits` method if the Survicate object is available, or by listening for a `SurvicateReady` event to perform the setup.
The core logic is encapsulated within a self-executing anonymous function,ensuring a clean namespace and efficient execution. This function initializes the TimesApps object and defines the `toiplus` method, which orchestrates the loading of these various tracking and engagement tools based on the dynamic conditions outlined.