The Morfik Google AdSense Package provides the required functionality to make using Google AdSense on your Morfik website easy.
A Quick Walkthrough
To use the Morfik Google AdSense Package, simply add the package to the project by utilizing the ‘Used Packages’ command on the project ribbon (see Figure 1), or simply drag the package file onto the application main client area. Once added, AdSense widgets will appear on the home ribbon when the form designer is active (see Figure 2). This widget is ready to use with no need for additional coding.
|Figure 1: Used Packages Command|
|Figure 2: Widget Gallery|
To start using any widget you need to place it on the form and fill the ‘AdClient’ property with your unique Google AdSense profile number (see Figure 3). If you don’t have one, visit the Google AdSense homepage www.google.com/adsense and sign up. After successfully signing up you will acquire your unique profile number of this type: pub-xxxxxxxxxxxxxxxx.
|Figure 3: AdClient Property|
You may also enter keywords into the AdKeywords property.
|Note:||Ads shown in the widget are relevant to keywords and not to the content of the form.|
You can now launch your project and see ads related to the widget you have chosen.
The Morfik Google AdSense Package consists of four widgets: Google TextOnly Ads, Google TextAndImage Ads, Google ImageOnly Ads and Google LinkUnit Ads.
Let's take a closer look at how they work.
- Google TextOnly Ads Widget
- Google TextAndImage Ads Widget
- Google ImageOnly Ads Widget
- Google LinkUnit Ads Widget
An example of using the Google AdSense Package
This example shows you how to easily bring Google AdSense to your project.
After installing the package, place the TextAndImage Ads, ImageOnly Ads and LinkUnit Ads widgets on a form (see Figure 4).
|Figure 4: AdClient Property|
The next step is to set your unique Google AdSense profile number in all the widgets (see Figure 3) and fill the AdKeywords property with keywords (see Figure 5). The ad content is directly related to the keywords you enter, so it is recommended to set at least 3–4 keywords that are the most definitive to the subject of the webpage. If keywords are absent there is a high possibility that ads won't appear or public ads will appear.
|Figure 5: Ad Keywords property|
You may also edit the color of ads so that they comply with a webpage design. Background color and the border (if present) can be edited with the 'Color' and 'Border Color' properties. To change the color of links, text or addresses in ads, choose the appropriate label and edit its font color, as shown in Figure 6:
|Figure 6: Ads design editing|
Now you can run the project and see that ads fully comply with widget settings (see Figure 7):
|Figure 7: Google Ads implementation results|