Changes for page ONEcount Javascript Widgets
Last modified by Admin on 2021/08/02 13:54
Summary
-
Page properties (3 modified, 0 added, 0 removed)
-
Objects (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Parent
-
... ... @@ -1,0 +1,1 @@ 1 +System Setup Detail and Technical Information - Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki.m elanie@one-count_com1 +XWiki.Admin - Content
-
... ... @@ -5,7 +5,7 @@ 5 5 6 6 (updated 10/12/16) 7 7 8 - 8 +\\ 9 9 10 10 **all.min.js**: This is the main script that's used for data collection, interacting with ONEcount. 11 11 ... ... @@ -163,7 +163,7 @@ 163 163 ))) 164 164 ))) 165 165 166 - 166 +\\ 167 167 168 168 (% style="margin-left: 60.0px;" %) 169 169 b. ** Objects** ... ... @@ -251,7 +251,7 @@ 251 251 ))) 252 252 ))) 253 253 254 - 254 +\\ 255 255 256 256 On top of this **all.min.js** also contains a library used for browser fingerprinting as well as a library used for getting flash info on the browser. The content of this files used to spread in 3 different files and now they're in one place. 257 257 ... ... @@ -261,13 +261,50 @@ 261 261 262 262 **fs.js:** This is the form scrapper script. Used to scrapped content from 3^^rd^^ party forms when they are being submitted. 263 263 264 - 264 +=== GCN.onecount.track(url, title, referrer, resourceId, callback): === 265 265 266 +By default, ONEcount widgets track impressions on each page load. For sites where one article is displayed per page, this works fine. But in cases where articles are displayed on the same page, i.e. infinite scroll, only the first one is tracked. 267 + 268 +This function is designed to provide an impression track for each article on a page. The function expects three parameters: 269 + 270 +* **url**: The url of the article that is supposed to be tracked. **This is required**. 271 +* **title**: This should be the same as the **title tag** if the article was displayed alone on the page. 272 +* **referrer**: The referrer of article. (For infinite scroll this can be the previous article in the scroll.) 273 +* ((( 274 +**resourceId**: this is optional. If set to a valid resourceId, that resource that will be used in order to perform gating or increase view_count. You can pass 0 in order to use the default resource associated with the url if any 275 +))) 276 +* ((( 277 +**callback**: function to be called after a request has been sent to ONEcount. This can return the number of articles read by the user for products with limit in timeframe 278 +))) 279 + 280 +While the impressions are being tracked, ONEcount will also check whether the user's subscription is still valid or not (e.g. limit of X articles per month has been reached). If the subscription is not valid, then the user will be taken to the subscription page. 281 + 282 +Let's assume I have a page where the first article is displayed when the page loads and three mores articles are displayed as the user scrolls down. The first article will be tracked by ONEcount, but for the three other articles, a call to GCN.onecount.track needs to be made to tell ONEcount that the articles have been displayed. The url should be the direct url of the article. The referrer should be the previous article's url. 283 + 284 +=== GCN.onecount.gate(resourceId, callback): === 285 + 286 +Gating is currently done based on a REGEX match of a url segment on page load. This function is designed to allow customers to gate content where gating can not be sufficiently managed using URL segments, or where content must be gated without a page load. 287 + 288 +This function expects **two parameter** : 289 + 290 +1. **resourceId** : this is the **resourceId** that will be used for gating and it's **required.** 291 +1. **callback:** this is a function that can be passed. The response from the gating request will be made available in the callback. The callback should expect one parameter which is a JSON object. The JSON object has a property called hasAccess which is a boolean (true/false). **true** means the user has access and **false** means he does not. 292 + 293 +Resource Ids are available in ONEcount on the resource listing page. 294 + 295 +To create a resource that uses this function, choose “Function” from the resource type pull-down, then enter a text return value in the box below. This return value is ignored for now, but may be used to trigger gating in the future. 296 + 297 +When the function is called and the user is not subscribed to the product that the resource belongs to, he will be taken to the registration page in order to do so. If he is already subscribed to the product then nothing will happen. 298 + 266 266 \\ 267 267 268 - 301 +\\ 269 269 303 +**__NOTE:__** If page load speed is ever a concern, it is recommended to use a third party service (such as tools.pingdom.com). By doing so, it will generate report of all items loading on your webpage along with their load times. Simply copy and paste your page's URL into the designated field and a test will be conducted immediately. If any** oc.net** item exceeds a load speed of 500ms, please enter a Helpdesk ticket for us to review. Testing page load speeds is a very informative way of identifying items that are directly impacting page performance. It is worth mentioning that there will be items that continuously load in short spurts (ex. **v.js** for viewability data) however those short spurts do not negatively impact load speed performance. 304 + 270 270 \\ 306 + 307 +\\ 271 271 {{/layout-cell}} 272 272 273 273 {{layout-cell}} ... ... @@ -308,11 +308,11 @@ 308 308 {{/expand}} 309 309 {{/panel}} 310 310 311 - 348 +\\ 312 312 313 - 350 +\\ 314 314 315 - 352 +\\ 316 316 {{/layout-cell}} 317 317 {{/layout-section}} 318 318 {{/layout}}
- Confluence.Code.ConfluencePageClass[0]
-
- id
-
... ... @@ -1,1 +1,1 @@ 1 -6 9796141 +66131 - url
-
... ... @@ -1,1 +1,1 @@ 1 -https://info.onecount.net//wiki/spaces/OD/pages/6 979614/ONEcount Javascript Widgets1 +https://info.onecount.net//wiki/spaces/OD/pages/66131/ONEcount Javascript Widgets