1. Issue with page title $title in single-page application

For single-page projects, there may be issues with the pre-set event collection of the page title attribute in the Sensing SDK.
Specific issue:
1. If the title is not updated and assigned, the collected title will always be the main page's title and will not change when switching pages. Therefore, the data sent when switching pages will not update the $title.
2. If the timing of setting the title is later than the timing of data sending, the $pageview event sent when switching pages will carry the value of the previous page's title.
Solution:
Complete the update of the title value before switching pages (using Vue as a common example).

router.beforeEach((to, from, next) => { 	document.title = '新页面的 title 值'; 	next() }) 
JS

2. Issue with using only built-in but not external plugins in asynchronous integration of Web SDK

In the case of asynchronous integration of the Web SDK, if you need to use built-in but not external plugins, make sure to load the Web SDK first and then use the relevant plugins. After using the plugins, enable the full tracking collection.

Using the page browsing duration plugin as an example:

//异步集成代码 sensors.quick('isReady',function(){ 	sensors.use('PageLeave') 	sensors.quick('autoTrack') })
JS
  • For asynchronous integration of Web SDK and using external plugins:
    • If you can ensure that the external plugins are loaded before the Web SDK, you can use the above method.
    • If you cannot guarantee that the external plugins are loaded before the Web SDK, this usage method is not supported for now.