New Delhi – A recent update to the TimesApps JavaScript library introduces enhanced tracking and user engagement capabilities, including integration with Survicate, Google Ads, and facebook Ads. The changes aim to provide a more personalized user experience and improve campaign effectiveness.
The updated code allows for dynamic loading of marketing and analytics tools based on user subscription status and geographical location. If a user is identified as a “prime” subscriber, thier subscription status is set to ‘paid’; or else, it defaults to ‘free’. Geolocation data is also captured, defaulting to ‘IN’ (India) if not otherwise specified.
The Survicate integration is designed to be activated once the Survicate library is ready.A function, `setAttributes`, is defined to capture user traits like subscription status and geolocation. This function is either called directly if the Survicate object and its `setVisitorTraits` method are available, or it’s attached as an event listener to the `SurvicateReady` event.
The script for Survicate is dynamically created and appended to the document’s head, pointing to a specific workspace URL. This ensures that the Survicate survey functionality is loaded asynchronously.
Furthermore, the `TimesApps.toiPlusEvents` function manages the loading of these integrations. It checks for the availability of site settings, specifically `isFBCampaignActive` and `isGoogleCampaignActive`.If these settings are present and the user is not a prime subscriber, Google and Facebook event tracking are initiated, along with Survicate, based on the provided configuration.
In scenarios where the initial site settings are not available or the user is a prime subscriber, the system fetches these settings from a remote URL via a `getFromClient` function. This dynamic fetching allows for real-time adjustments to campaign tracking based on the latest configurations, including specific Survicate section allowances for prime users.
This update signifies a move towards more refined,data-driven user engagement strategies within the TimesApps ecosystem,enabling tailored interactions and performance measurement across various digital marketing channels.