/
Page tracking code improvements
Page tracking code improvements
In-Portal has "Default Analytics Tracking Code
" setting, where default tracking code, that will be injected close to </body>
tag can be placed.
Such approach works with most analytics tools (e.g. HubSpot, Old Google Analytics - ga.js, etc.). Unfortunately New Google Analytics code (the analytics.js) requires to be placed right before </head>
tag on the page. So if both HubSpot and New Google Analytics needs to be used, then we've got a problem (unless user is able to edit template files directly).
Solution
- create 2nd setting that will be called "
Default Analytics Tracking Code (placed before </head>)
" - rename existing setting to the "
Default Analytics Tracking Code (placed before </body>)
" - create corresponding DB field in the "c" unit so that each page can override it
- update
PageInfo
tag to support returning other tracking code