That address in Safari's URL field (the one that shows "track.toroadvertising" etc) is commonly referred to as a browser redirect. Its name isn't particularly important or relevant since it changes all the time, and as you can see its sole purpose is to promote garbage that should never be installed on any Mac.
If that's happening routinely, then you may have inadvertently downloaded and installed adware. You most certainly do not need to download or install anything else to fix it.
Navigate to the following folder, and post its contents in a screenshot.
~/Library/LaunchAgents
To open that folder, copy the entire line above and paste it in the Finder's Go menu > Go to Folder... field. Make it look like this:
... and click the Go button.
A Finder window will open. Take a screenshot showing all that folder's contents, and post it in a reply. To take a screenshot read the Appendix in the following User Tip: Writing an effective Apple Support Communities question.
Usually, there is nothing in that folder so don't be surprised to find it empty. The reason for starting with that folder is to eliminate other potential causes before proceeding with steps that will identify and eradicate whatever is affecting that Mac.
There will be additional instructions to follow and this is just the first step.
For a description of how this may have occurred, how to avoid it in the future, and for Apple's recommended actions read How to install adware.
Review your Gatekeeper settings: OS X : About Gatekeeper - Apple Support. Gatekeeper is designed to help prevent you from inadvertently installing garbage software.
If you get impatient and want to "read ahead" the remedy will follow the format of this Discussion: "root" process has high energy impact which drains my battery fast.