Update how external link tracking is done.
Don't depend on the body variable being in the outer scope.