Fix to save the hits correctly to the database

Fix to save the hits correctly to the database
Merge remote-tracking branch 'origin/redirect-hits-fix' into redirect-hits-fix