- Go to your Admob Account, and Add your mobile site under ‘sites and apps’.
- After adding the site, you’ll see a set of codes. You need to choose PHP Curl.
- Copy the entire code to a notepad file and insert ?> at the very end of the file.
- Now, save the file as – admob.php .
- Now, create a new notepad file and insert the following code into it:
<?php echo admob_request($admob_params); ?>
- Now save this file as admob_request.php
- Now, upload both these files (admob.php & admob_request.php) to the root directory of your website.
- You now need to make calls to these files from your HTML page, where you want to include the ads. To do that, move on to next step.
- Open your page (where you want to insert the ads) for editing in some HTML or text editor. You can chose from online editor (if your host provides) if it doesn’t you can use notepad too.
- Insert the following code at the exact location where you want to add the advertisement.
<?php include("admob.php"); ?>
- It will show up advertisement at that place. If you need to add any more advertisements at the same page, insert the following code wherever you need more ads on the same page.
<?php include("admob_request.php"); ?>
- For better ad functionality, you can call following code on command on any page:
admob_setcookie()
That’s the whole procedure to insert the ads. Once the Test Ads starts showing up, change the value of TEST_MODE in admob.php from true to false. You’ll see real ads showing up.
If you have any doubts or issues adding admob ads to your site, kindly let me know. I’ll try my best to help you.