Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

DTM Page Tags with Angular.js framework

Cleve_Young
Level 2
Level 2

We have an internal site we are tracking, which is a single page which uses Angular.js framework to change views and content. I've set up some code within Angular to fire the s.t() call every time a "page" displays. The s.t() call works as expected for each 'page' rendered by the Angular code. What I'm running into though is on the initial load of the URL, we are getting two s.t() calls:
 1 - A 'generic' call which has no pageName specific data, since that is set within the Angular display code. I'm assuming this is the s.t() triggered by the pageBottom() function. We do not want this as it fires before the Angular code has a chance to build and populate the required values.

2 - The s.t() call fired by the Angular code as it is triggered when that code displays the first 'page' content. This is working as expected and is the call we want.

Once past the initial page load, only a single s.t() call is being made for each new "page". My question is what is the best way to stop the empty call #1 from automatically being sent.

1 Accepted Solution
Ben_Bytheway
Correct answer by
Employee
Employee

Inside of DTM, you can put

return false;

in the "Customize Page Code" to suppress the beacon from firing for the initial call.  Let me know if that fixes this or not.  🙂

View solution in original post

2 Replies
Ben_Bytheway
Correct answer by
Employee
Employee

Inside of DTM, you can put

return false;

in the "Customize Page Code" to suppress the beacon from firing for the initial call.  Let me know if that fixes this or not.  🙂

View solution in original post

Cleve_Young
Level 2
Level 2

Thanks!! Works like a charm. I never thought of putting that within the Tools custom code, I kept thinking of the page load rule.