If you want to make money from your Google Page Creator Web site but you don't already have a Google Adsense account then the first thing you will need to do is sign up for a Google Adsense account.
Create Your Google Adsense Code
Google Adsense Code
• Once you have signed up for Google Adsense click on the tab marked "Adsense Setup".
• On this page click on the link that says "Adsense for Content".
• Make sure "Ad Unit" is checked on the next page and click "Continue".
• Choose the size of the add you want and the color and click "Continue" again.
• Your code will now be showing. Highlight and copy all the code in the box. Be careful that you get it all.
Log Into Your Google Page Creator Page
Open Google Page Creator Web Page
Now that you have the Google Adsense code that you are going to add to your Google Page Creator Web page log in to your Google Page Creator Web site editing page. Click on the page that you want to add your Google Adsense code to. The editing page will open in your browser for the page you want to add your Google Adsense ad to.
Choose Your Area
Add Content to Google Page Creator Sidebar
Decide where on your Google Page Creator page you want to add your Google Adsense ad. Click on that area. You will now see a line (cursor) inside the area.
Add Google Adsense Code
Empty Google Page Creator Content Area
• In the left hand navigation bar of your Google Page Creator editing page all the way to the bottom of the page is a little link that says "Edit HTML" click on this link.
• A new window will pop up with a little piece of code in it. Leave the
and the
and delete the rest. If you already have content here then don't worry about this part.• In between these two pieces of code you need to paste the Google Adsense code that you copied from the Google Adsense code earlier.
• Click the "Save Changes" button at the bottom of the page.
Preview Your Page
Google Page Creator Publish Preview Button
Your editing page may look like there is nothing in the area that you just added your Google Adsense code to. That's alright.
• Next to the "Publish" button is a link that says "Preview" click on this to see how your Google Page Creator page looks with it's new Google Adsense ad.
• A new window will pop up with your new page in it.
• If you like the way the page looks then close this window and click on the "Publish" button.
• If you don't like the way the new page looks yet then continue editing until it looks the way you want it to.
You can now start making money whenever someone clicks on ont of your ads. Get more people to your site. More people equals more money.
//////////////////////////////////////////////////////////////NEXT//////////////////////
Ever wanted to add a Google Map to your site but only had 15 minutes to spare? Now you can add a map and still have time to brag to your mates and bask in the worship that (inevitably) comes afterward.
Basically, the guys over at subgurim.net have already done all the hard work in writing the .Net wrapper for Google Maps. Problem is, the examples on their site are mostly in spanish & its a bit difficult to find out exactly what is needed to get everything working.
But all this is cutting into your bragging time - so lets get started!
1. Get a Google Maps API key from here:
http://www.google.com/apis/maps/
2. Download the SubGurim wrapper dll from here:
http://en.googlemaps.subgurim.net/descargar.aspx
3. Unzip it, and put it in your \bin directory
4. Add it to your toolbox by
Tools -> Choose Toolbox Items -> Browse -> Select the .dll file -> OK
GMap will now be in the ‘Standard’ area of your Toolbox.
5. Add a new webpage.
6. Drag the GMap from the toolbox onto the page. A new instance of the GMap will appear on the page, with the name ‘GMap1′
7. Add the following lines to your web.config file:
Add the following code to your Page.Load sub
Dim sStreetAddress As String
Dim sMapKey As String = ConfigurationManager.AppSettings("googlemaps.subgurim.net")
Dim GeoCode As Subgurim.Controles.GeoCode
sStreetAddress = "100 Russell St. Melbourne. VIC. 3000. Australia"
GeoCode = GMap1.geoCodeRequest(sStreetAddress, sMapKey)
Dim gLatLng As New Subgurim.Controles.GLatLng(GeoCode.Placemark.coordinates.lat, GeoCode.Placemark.coordinates.lng)
GMap1.setCenter(gLatLng, 16, Subgurim.Controles.GMapType.GTypes.Normal)
Dim oMarker As New Subgurim.Controles.GMarker(gLatLng)
GMap1.addGMarker(oMarker)
Press F5, and start basking in the glory
////////////////////////////////////Help/
1. Thanks for the reply. I checked the name of the map control & it
is Gmap1. I have the following code in my default.apsx page:
default.aspx:
=========
default.aspx.vb:
==========
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim sStreetAddress As String
Dim sMapKey As String = ConfigurationManager.AppSettings(”googlemaps.subgurim.net”)
Dim GeoCode As Subgurim.Controles.GeoCode
sStreetAddress = “100 Russell St. Melbourne. VIC. 3000. Australia”
GeoCode = GMap1.geoCodeRequest(sStreetAddress, sMapKey)
Dim gLatLng As New Subgurim.Controles.GLatLng(GeoCode.Placemark.coordinates.lat, GeoCode.Placemark.coordinates.lng)
GMap1.setCenter(gLatLng, 16, Subgurim.Controles.GMapType.GTypes.Normal)
Dim oMarker As New Subgurim.Controles.GMarker(gLatLng)
GMap1.addGMarker(oMarker)
End Sub
===============
This code complains that Gmap1 is not declared.
////////////////////////////////////////////NEXT.////////////
ADD Draggable markers and Events to your Google Maps
Following on from my last post on how to add Google Maps to your ASP.Net site, I’m now going to show how easy it is to add draggable markers to your map.
First, make sure you have the map working on your webform.
Having the map fire server-side events on user actions is pretty simple, and here is the code:
Private Sub AddEventToMapDemo()
Dim GeoCode As Subgurim.Controles.GeoCode
Dim sMapKey As String = System.Configuration.ConfigurationManager.AppSettings("googlemaps.subgurim.net")
GeoCode = GMap.geoCodeRequest("3052. VIC. australia", sMapKey)
Dim gLatLng As New Subgurim.Controles.GLatLng(GeoCode.Placemark.coordinates.lat, GeoCode.Placemark.coordinates.lng)
GMap.setCenter(gLatLng, 16, Subgurim.Controles.GMapType.GTypes.Normal)
Dim oOption As New Subgurim.Controles.GMarkerOptions
oOption.draggable = True
oMarker = New Subgurim.Controles.GMarker(gLatLng, oOption)
GMap.addGMarker(oMarker)
GMap.addListener(New Subgurim.Controles.GListener(oMarker.ID, Subgurim.Controles.GListener.Event.dragend, _
"function(){{ var ev = new serverEvent('dragend', 0); ev.addArg(" & oMarker.ID & ".getPoint().lat()); ev.addArg(" & oMarker.ID & ".getPoint().lng()); ev.send(); }}"))
End Sub
You then need to add code to handle the event:
Protected Function GMap_ServerEvent(ByVal s As Object, ByVal e As Subgurim.Controles.GAjaxServerEventOtherArgs) As String
If e.eventName = "dragend" Then
Response.Write("New Latitude =" & e.eventArgs(0) & ", New Longitude = " & e.eventArgs(1))
End If
End Function
The server-side event will be fired every time the marker is dragged and dropped.
In my situation, I wanted to allow the user to drag & drop the marker as many times as they wanted - and only store the new Lat/Long values when the user pressed the Save button.
This is a little bit harder to code as the variables used to reference the marker cannot be accessed globally - so we can’t just read their values when the user presses the save button (to the gurus: I’m sure they can, but I couldn’t find an easy way to get at them) . However, we can store them in hidden fields when the DragEnd event is raised, and examine those fields when Save is pressed.
Add these fields to your webform:
And add this sub to your code-behind:
Private Sub NewLatLongOnSaveMapDemo()
Dim GeoCode As Subgurim.Controles.GeoCode
Dim sMapKey As String = System.Configuration.ConfigurationManager.AppSettings("googlemaps.subgurim.net")
GeoCode = GMap.geoCodeRequest("3052. VIC. australia", sMapKey)
Dim gLatLng As New Subgurim.Controles.GLatLng(GeoCode.Placemark.coordinates.lat, GeoCode.Placemark.coordinates.lng)
GMap.setCenter(gLatLng, 16, Subgurim.Controles.GMapType.GTypes.Normal)
Dim oOption As New Subgurim.Controles.GMarkerOptions
oOption.draggable = True
oMarker = New Subgurim.Controles.GMarker(gLatLng, oOption)
GMap.addGMarker(oMarker)
GMap.addListener(New Subgurim.Controles.GListener(oMarker.ID, Subgurim.Controles.GListener.Event.dragend, _
"function(){ document.getElementById('hidLat').value=" & oMarker.ID & ".getPoint().lat();document.getElementById('hidLng').value=" & oMarker.ID & ".getPoint().lng() }"))
End Sub
And here is the ‘Save’ button click event:
Protected Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Response.Write("New Latitude =" & hidLat.Value & ", New Longitude = " & Me.hidLng.Value)
End Sub
No comments:
Post a Comment