Skip to content

Commit

Permalink
trackPage in all cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Kaplan authored and Steven Kaplan committed Nov 7, 2021
1 parent 6e02f07 commit c557422
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
9 changes: 0 additions & 9 deletions templates/js/linker.v1.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,15 +364,6 @@
};

ns._trackPage = function() {
if (ns.trackedMatches.length === 0 && ns.matches.length > 0) {
// we want to track page in two cases:
// 1) if there are trackedMatches found
// or 2) if there are no trackMatches found AND no matches found, as we want to send a message
// to api/linker_track so that the backend will delete the webpage.
// however, this if statement is a third case:
// when there are no trackMatches found but there are matches found, we don't want to track page
return;
}
var robots = document.head.querySelector("meta[name~=robots]");
if (robots && robots.content.includes("noindex")) { return; }

Expand Down
9 changes: 0 additions & 9 deletions templates/js/linker.v2.js
Original file line number Diff line number Diff line change
Expand Up @@ -618,15 +618,6 @@
};

ns._trackPage = function() {
if (ns.trackedMatches.length === 0 && ns.matches.length > 0) {
// we want to track page in two cases:
// 1) if there are trackedMatches found
// or 2) if there are no trackMatches found AND no matches found, as we want to send a message
// to api/linker_track so that the backend will delete the webpage.
// however, this if statement is a third case:
// when there are no trackMatches found but there are matches found, we don't want to track page
return;
}
var robots = document.head.querySelector("meta[name~=robots]");
if (robots && robots.content.includes("noindex")) { return; }

Expand Down

0 comments on commit c557422

Please sign in to comment.