@@ -279,10 +279,11 @@ function attachPageFindSearchTracker() {
279279 else if ( ( ( depth_of_path == 4 ) | ( depth_of_path == 5 ) ) & ( current_path . includes ( '/learning-paths/' ) ) ) {
280280 /* Assign to the following components:
281281 0. Onload detection
282- 1. Tags (only for intro and next step pages)
283- 2. Review ('check answer' button)
284- 2.5. Review (if all correct, add trigger for analytics somehow)
285- 3. Feedback (on Next Steps page)
282+ 1. Tags (on Intro page)
283+ 2. Feedback (on Next Steps page)
284+ 3. Share (on Next Steps page)
285+ 4. CTAs (on Next Steps page)
286+ 5. Further Reading links (on Next Steps page)
286287 */
287288
288289
@@ -351,7 +352,9 @@ function attachPageFindSearchTracker() {
351352 } ) ;
352353 }
353354
355+ // REMOVED NOW THAT REVIEW PAGE IS REMOVED. SAFE TO TAKE OUT.
354356 // 2) Review check answer btn and answers
357+ /*
355358 let check_answer_btn = document.getElementById('check-answer-btn');
356359 if (check_answer_btn) {
357360 // check answer button
@@ -389,9 +392,10 @@ function attachPageFindSearchTracker() {
389392 });
390393 });
391394 }
395+ */
392396
393397
394- // 3 ) Feedback on Next Steps page
398+ // 2 ) Feedback on Next Steps page
395399 // trackStarRating
396400 let stars = document . querySelectorAll ( 'input[name=rating]' ) ;
397401 for ( let star of stars ) {
@@ -407,7 +411,47 @@ function attachPageFindSearchTracker() {
407411 trackChoiceFeedback ( feedback ) ;
408412 } ) ;
409413 }
414+
415+ // 3) Share on Next Steps page
416+ let share_a = document . getElementsByClassName ( 'share-button' ) ;
417+ for ( let share_link of share_a ) {
418+ share_link . addEventListener ( "click" , ( ) => {
419+ _satellite . track ( 'content-interaction' , {
420+ 'data-track-type' : 'learning-path-next-steps' ,
421+ 'data-track-location' : 'share' ,
422+ 'data-track-name' : share_link . getAttribute ( 'name' ) // will be 'LinkedIn' or 'Facebook' or 'Email' or similar.
423+ } ) ;
424+ } ) ;
425+ }
426+
427+ // 4) CTAs on Next Steps page
428+ let cta_links = document . querySelectorAll ( '.next-step-cta' ) ;
429+ for ( let cta of cta_links ) {
430+ console . log ( 'ctalink' , cta ) ;
431+ cta . addEventListener ( "click" , ( ) => {
432+ _satellite . track ( 'content-interaction' , {
433+ 'data-track-type' : 'learning-path-next-steps' ,
434+ 'data-track-location' : cta . getAttribute ( 'name' ) , // either 'Event', 'DevProg', or 'Developer.arm.com'
435+ 'data-track-name' : cta . getAttribute ( 'data-event-name' ) // if Event, gives event name, otherwise, null.
436+ } ) ;
437+ } )
438+ }
439+
440+ // 5) Further Reading links on Next Steps page
441+ let further_reading_links = document . querySelectorAll ( '#further-reading-div a' ) ;
442+ for ( let link of further_reading_links ) {
443+ link . addEventListener ( "click" , ( ) => {
444+ _satellite . track ( 'content-interaction' , {
445+ 'data-track-type' : 'learning-path-next-steps' ,
446+ 'data-track-location' : 'metadata' ,
447+ 'data-track-name' : 'further-reading-link'
448+ } ) ;
449+ } ) ;
450+ }
451+
452+
410453 // metadata marking for similar learning paths, further reading, next learning path.
454+ /* All obsolete in new design
411455 let next_learning_path_link = document.getElementById('next-learning-path');
412456 if (next_learning_path_link) {
413457 next_learning_path_link.addEventListener("click", () => {
@@ -419,7 +463,6 @@ function attachPageFindSearchTracker() {
419463 });
420464 }
421465
422-
423466 let similar_lp_links = document.querySelectorAll('#similar-lp-div a');
424467 for (let link of similar_lp_links) {
425468 link.addEventListener("click", () => {
@@ -430,16 +473,7 @@ function attachPageFindSearchTracker() {
430473 });
431474 });
432475 }
433- let further_reading_links = document . querySelectorAll ( '#further-reading-div a' ) ;
434- for ( let link of further_reading_links ) {
435- link . addEventListener ( "click" , ( ) => {
436- _satellite . track ( 'content-interaction' , {
437- 'data-track-type' : 'learning-path-next-steps' ,
438- 'data-track-location' : 'metadata' ,
439- 'data-track-name' : 'further-reading-link'
440- } ) ;
441- } ) ;
442- }
476+
443477 let explore_tag_links = document.querySelectorAll('#explore-tags-div ads-tag');
444478 for (let link of explore_tag_links) {
445479 link.addEventListener("click", () => {
@@ -450,6 +484,7 @@ function attachPageFindSearchTracker() {
450484 });
451485 });
452486 }
487+ */
453488
454489
455490 // 4a) Navitaion from navbar
0 commit comments