Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adding Adsense code snippet
#1
I see a few folks have the same problems as me adding Adsense code snippets.
I have fixed the problem in my FOOTER by making it a COMPONENT and inserting the snippet there and all works fine.

However, in the body of the pages it does not work. I have seen instruction to simply add the code into the source. This does not work. Well it works once, then the snippet changes and stops working. (see the page source).

I have also seen that the snippets/scripts are not supported, so this would explain that.

See the page source  here for an example - the snippets are there but not how I entered them.

I have not been able to find the solution to this. It looks like I need to create a new COMPONENT with the code in it then somehow link it to the places on the page where I want the ads to appear.

I'm a novice user of GetSimple and not technical so if anyone knows how I do it some simple instructions would be much appreciated. This site is my first one with GetSimple and I love it so far - just need the ads to work.
thanks
Mike
Reply
#2
Well bloody hell - I've worked it out!!
As I didn't see the solution anywhere let me share how I did it.

For reference, the site I've done this on is The Best of British.
The ads in question are the ones on the CHAPTERS pages, every few inches down the page amongst the paragraphs of text (the footer ads are not what I am addressing here).

First you need to create a COMPONENT and insert your AdSense code into. You do this under THEME (top menu) then EDIT COMPONENTS (right hand menu), then ADD COMPONENT.
I named mine "advert" as you see here and just copied/pasted the AdSense code in:

[Image: 1.PNG]

Second, you need to go to the PAGE you wish to insert the ad into. Click on SOURCE then insert:
{% name %} wherever you want the ad to appear.
Replace "name" with the name you called your component. In my case it's "advert" as you can see below.
The <p> tags I did not enter - they were added automatically.

[Image: 2.PNG]

To see the result just look at the page and scroll down and you will see ads at intervals.

Interestingly if you VIEW SOURCE of the page you will that the little code above actually pulls the whole AdSense snippet / script into the resulting html that makes up the page. Quite clever really.
Reply
#3
First of all, you are using Dynpages plugin, right? Otherwise components on pages won't work.
I think you don't need to go into source mode, you can just paste the {% ... %} in the page edit screen.
Reply
#4
Quite right! I just looked and the Dynpages plugin is there. (I did say I was a novice user :-) )
And yes you are also right, no need to go into SOURCE to add the {% name %}, both ways work though.
If there are better ways to solve this feel free to share but this is how I did it so maybe it will help someone else :-)
Reply
#5
Afaik this is the simplest and most used way.
Reply




Users browsing this thread: 1 Guest(s)