The boinc client, and presumably any third party programs, read the project's home page looking for a link to the scheduler. If you load PrimeGrid's homepage and look at the page source in your browser, a few lines from the bottom you'll see this:
<!-- <scheduler>http://www.primegrid.com/cgi/cgi</scheduler> -->
<link rel="boinc_scheduler" href="http://www.primegrid.com/cgi/cgi">
The program is looking for either the <scheduler> tag in the comment or the <link> tag.
My lucky number is 75898524288+1