Adding Google AdSense to shop and...

User 38401 Photo


Senior Advisor
10,951 posts

JRCDyer wrote:
Just a thought, but if it were me I wouldn't be putting ads for other products in places where I'm trying to sell my own stuff. Aren't you concerned that people will see an ad in your shop, follow it, and buy from another place instead of yours? I'm not sure if that's worth the $0.50 Google pays per click, or whatever it decides to be.

Any-who, what I would do is float the ad to the right.


<style type="text/css">
.ad1 {
display: block;
float: right;
width: 120px;
height: 600px;
}
</style>

<div class="ad1">
Google code
</div>



Make sure the CSS within the style tags goes into your CSS stylesheet ;)


Without the <style> and </style> tags (had to add this as having seen so many follow that instruction to add it to their CSS file and they do it verbatim lol. Then can't figure out why it doesn't work :P
User 2356538 Photo


Registered User
14 posts

I think I have narrowed down my problem to having something to do with line breaks. When I paste the code into the item description html tool and publish the site it is not reading the line breaks. This is essentially the only difference I can find in my code and Eric's exact code (used for testing).

Any help? Could this be the problem?

Eric's source code (works)
view-source:http://progrower.coffeecup.com/shop/viewcategory.php?groupid=28
<style type="text/css"> <!--#adsensecode {float:right ;padding-right: 100px;}#textbox {text-align:justify;text-justify:inter-word;width:20em} --> </style><div id="adsensecode"><script type="text/javascript"><!--
google_ad_client = "ca-pub-6600248762472507";
/* test */
google_ad_slot = "0107552881";
google_ad_width = 120;
google_ad_height = 240;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>


My source code (doesn't work)
view-source:http://rodsdeals56.com/shop/viewitem.php?productid=8
<style type="text/css"> <!--#adsensecode {float:right ;padding-right: 100px;}#textbox {text-align:justify;text-justify:inter-word;width:20em} --> </style><div id="adsensecode"><script type="text/javascript"><!--google_ad_client = "ca-pub-6600248762472507";/* test */google_ad_slot = "0107552881";google_ad_width = 120;google_ad_height = 240;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script></div>



I have tried using enter, return, everything I can think of, but the line breaks still do not show in the source code. However, I can paste the code in an html editor and it works like a charm.
User 2356538 Photo


Registered User
14 posts

Yes, I uploaded the shop.

Here is the source page:
view-source:http://rodsdeals56.com/shop/viewitem.php?productid=8

Do you see what I am talking about with line breaks not showing? Would that have an effect?

The only other difference in our source code that I can find is the <p> tag before my code, but I think that is built into the SCCP code, because I am not putting it in there.
User 187934 Photo


Senior Advisor
20,273 posts

I had a problem with my shop rendering the code nonfunctional when I republished the shop. I re-pasted the adsense in again, republished and it showed. I made another change to a different page and had to re-paste the code again after that change. The script doesn't work if you republish for some reason. It rearranges the code and the script doesn't like it. I wasn't going to bring it up unless you had problems. try re-pasting the code and publish immediately after and see if that fixes the issue.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2356538 Photo


Registered User
14 posts

I think we have found the problem, however, I cant get it to work right even with creating a new test product, pasting the code and publishing immediately.

Is there any way to force these line breaks by adding something to the code?
User 187934 Photo


Senior Advisor
20,273 posts

Let me give something a try.
* Starts the elevator music *
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 187934 Photo


Senior Advisor
20,273 posts

Ok here's the work around.:)
Paste your adsense and html code that I provided into your page but not with the html tool.
Don't put any brackets around the code.
Now preview your shop locally.
Browse to the page with the adsense code on it and copy all the code as it appears.
Now go back to SCCP and delete all the code on your page and paste the code that you just copied into your page using the html tool.
Now publish.
This is what I did and it now seems to work even after republishing.
You can see it in my shop on test2.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2356538 Photo


Registered User
14 posts

This didn't work for me, I tried it every way possible. I followed your instructions exactly. Even tried previewing in different browsers, creating a completely new product............

Any other ideas?

Again, thank you so much for your help.
User 187934 Photo


Senior Advisor
20,273 posts

I just placed the code from your script on my test2 page copy what you see and paste that into your page using the html tool. I copied it straight from my page.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2356538 Photo


Registered User
14 posts

This didn't work either....Sorry....I promise I was really hoping it would....

Just a thought, but is there some way to define most of this code/script in the header section and then call it in the item description....something like a onload command for a java script function.

I pasted the code in the header section, and the ad displays on all pages, just not where we want it.

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.