New Delhi – In a strategic move to enhance user engagement adn campaign tracking, TimesApps has rolled out a new JavaScript integration designed to manage marketing and analytics events across its digital platforms. This initiative aims to provide granular control over campaign visibility and data collection, particularly for Google and Facebook advertising efforts.
the integration, encapsulated within the `TimesApps.toiPlusEvents` function, allows for dynamic loading of scripts based on user status and campaign configurations. When specific site settings are available and the user is not identified as a prime subscriber, the system directly triggers the loading of Google gtag events and Facebook Pixel (FBEvents) based on flags like `isGoogleCampaignActive` and `isFBCampaignActive`. Additionally, it manages the integration of survicate, a customer feedback platform, by loading its JavaScript snippet conditionally based on `allowedSurvicateSections`.
In scenarios where initial site settings are not readily available or when a prime user layout is detected,the system defaults to fetching configuration data from a remote endpoint. A call to `https://jarvis.indiatimes.com/v1/feeds/toi_plus/site_settings/643526e21443833f0c454615?db_env=published` retrieves these settings. The response from this endpoint then dictates whether Google and Facebook events are loaded, and which Survicate sections are enabled, differentiating between prime and non-prime user experiences through `allowedSurvicatePrimeSections` and `allowedSurvicateSections` respectively.
The Survicate integration itself is robust, ensuring the platform is ready before attempting to set visitor traits. If the Survicate object (`w._sva`) and its `setVisitorTraits` method are available, a local `setAttributes` function is called immediately. Otherwise, the system registers an event listener for `SurvicateReady` to ensure `setAttributes` is executed once the Survicate library is fully initialized. The `setAttributes` function is responsible for configuring visitor traits, including `toi_user_subscription_status` and `toi_user_geolocation`, with a default country code of ‘IN’ if not or else specified.
This comprehensive approach underscores TimesApps’ commitment to leveraging data for optimized marketing campaigns and improved user insights, ensuring that relevant tracking and feedback mechanisms are activated according to predefined conditions and user segmentation.