Adding Google AdSense to shop and...

User 187934 Photo


Senior Advisor
20,273 posts

Here I was thinking the adsense wasn't showing.
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

It doesn't show if I use the HTML to paste it into the item description like we are trying. I went to the custom markup header section to get it to show, just to see if I could get it to work that way.

It shows up if the code is in the custom markup section, but doesn't show if the code is in the item description.
User 187934 Photo


Senior Advisor
20,273 posts

I just tried testing a theory and closed my SCCP and reopened and republished my shop and all the adsense has stopped showing. I do believe I will open a support topic. The shop is rearranging the code making it malfunction.
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

Thanks, I'll keep working and let you know what I find out. I think I am going to try something with defining the code in another file to upload, and referencing that file from SCCP.

That's a stretch for me, but I will win eventually.


Thanks again for all your help.
User 187934 Photo


Senior Advisor
20,273 posts

An iframe would work.
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

Finally!!!

Ok here is what I did.

1. Created an html file as follows with the google adsense code, and uploaded via direct ftp:
<!DOCTYPE html>
<html lang="en">
<body>
<script type="text/javascript"><!--
google_ad_client = "ca-pub-1790392472815918";
/* Product Right */
google_ad_slot = "4606997194";
google_ad_width = 120;
google_ad_height = 240;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</body>
</html>


2. Added the css styling to the overall shop header:
<style type="text/css"> <!--#adsensecode {float:right ;padding-right: 100px;}#textbox {text-align:justify;text-justify:inter-word;width:20em} --> </style>


3. Called the code using iframe as follows:
[[[<iframe id="adsensecode" src="http://rodsdeals56.com/googlead.html" width="120" height="240" scrolling="no"></iframe>]]]



And it works, still have a little refining to do, but it works every time. Any suggestions?


Thanks for all your help.

Forgot the result:

http://rodsdeals56.com/shop/viewitem.php?productid=8
User 187934 Photo


Senior Advisor
20,273 posts

I still put in a support topic as we shouldn't have to go that far.:)
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

As an update to this, the issue has been noted. The best approach is to use an Iframe to keep SCCP from rearranging the code until the CC developers can implement a fix in a future update.:)
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 have came up with a much better solution.

Also, after looking on the Adsense site I believe that the use of Iframes does not fit within their policies.

Their policy also states not to edit their code, however, my new method requires separating the code (so use at your own risk, I can not say that this fully complies with their policies)

The Solution:

1. Paste the first <script> section of the code into the additional header content for the entire shop, it should look something as follows:

<script type="text/javascript"><!--
google_ad_client = "Your Publishing ID Here";
/* Product Right */
google_ad_slot = "4606997194";
google_ad_width = 120;
google_ad_height = 240;
//-->
</script>


2. Paste the second <script> section in the product description using the html tool, I used div tag floated right to suite my purposes.

<div style="float: right;"><script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>



Works like a charm. This is a MUCH better method than using the iframes
User 187934 Photo


Senior Advisor
20,273 posts

Thanks for that additional work around James. CC is aware of the issue and they may fix it by the next up date. At least there's a way to make it work.:)
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

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.