- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
07-15-2020 08:11 AM
I implemented event tracking for a website which uses the utag.link() method to send out the events. This works consistently on our dev and staging systems but on our production system it works very erractically (I would say around 40% of the time).
When it doesn't work, I get this console log:
17:08:23.129 utag.js:45 trigger:link 17:08:23.129 utag.js:45 {at_event_type: "action", event_name: "header_click", event_category: "content interaction", event_action: "header_open", event_value: "menu"} 17:08:23.129 utag.js:45 trigger:called before tags loaded 17:08:23.129 utag.js:45 Tag 6 did not LOAD
When it does work, I get this:
17:08:50.832 utag.js:45 trigger:link 17:08:50.832 utag.js:45 {at_event_type: "action", event_name: "header_click", event_category: "content interaction", event_action: "header_open", event_value: "menu"} 17:08:50.832 utag.js:45 utag.loader.RD 17:08:50.832 utag.js:45 {at_event_type: "action", event_name: "header_click", event_category: "content interaction", event_action: "header_open", event_value: "menu"} 17:08:50.833 utag.js:45 Read page variables 17:08:50.834 utag.js:45 ReferenceError: js is not defined at Object.utag.pagevars (utag.js:66) at Object.RDpv (utag.js:14) at Object.RD (utag.js:15) at Object.trigger (utag.js:55) at Object.track (utag.js:46) at Object.link (utag.js:46) at VM4778 index.js:9 17:08:50.834 utag.js:45 RE: blr 17:08:50.834 utag.js:45 {at_event_type: "action", event_name: "header_click", event_category: "content interaction", event_action: "header_open", event_value: "menu", …} 17:08:50.834 utag.js:45 {at_event_type: "action", event_name: "header_click", event_category: "content interaction", event_action: "header_open", event_value: "menu", …} 17:08:50.834 utag.js:45 Load Rules 17:08:50.834 utag.js:45 {at_event_type: "action", event_name: "header_click", event_category: "content interaction", event_action: "header_open", event_value: "menu", …} 17:08:50.834 utag.js:45 {13: 0, 14: 0, 15: 0, 16: 0, 20: 0, 28: 0} 17:08:50.835 utag.js:45 RE: alr 17:08:50.835 utag.js:45 All Tags EXTENSIONS 17:08:50.835 utag.js:45 {at_event_type: "action", event_name: "header_click", event_category: "content interaction", event_action: "header_open", event_value: "menu", …} 17:08:50.835 utag.js:45 {at_event_type: "action", event_name: "header_click", event_category: "content interaction", event_action: "header_open", event_value: "menu", …} 17:08:50.835 utag.js:45 SENDING: 6 17:08:50.835 utag.js:45 RE: end 17:08:50.835 utag.js:45 {at_event_type: "action", event_name: "header_click", event_category: "content interaction", event_action: "header_open", event_value: "menu", …} 17:08:50.836 utag.js:45 {at_event_type: "action", event_name: "header_click", event_category: "content interaction", event_action: "header_open", event_value: "menu", …}
What could I be doing wrong? Any pointers?
Solved! Go to Solution.
07-15-2020 08:12 AM
07-22-2020 12:29 AM - edited 07-22-2020 12:31 AM
I opened a support ticket and with the help of a very skilled technician was able to find the solution to my problem:
We are using server side rendering for our website. Due to this, there was some issue with the tracking being initialized twice (once during the prerender and once during the page load) and then scripts being executed in the wrong order. I solved this by not running the tracking initialization during prerender (by checking whether the user agent is controlled by automation with navigator.webdriver [docs])
Copyright All Rights Reserved © 2008-2023