Google Plus 1

Started by rockmellon on 4 Jun 2011, 4:03 AM · Views: 6,920

Results 1 to 20 of 30
4 Jun 2011, 4:03 AM
#1
rockmellon avatar

rockmellon

New Zenner

Join Date:
Sep 2009
Posts:
19
Plugin Contributions:
0

Google Plus 1

I want to add the Google plus 1 script to my site.

It says to add the first part of the code to the head

<script type="text/javascript" src="http://apis.google.com/js/plusone.js"></script>

The second part of the code is to be added to the body.

<g:plusone></g:plusone>

Can you tell me how and where to add these codes in Zen Cart v1.3.9h

Thank you.

4 Jun 2011, 7:05 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Google Plus 1

You should check that you can make this link https versus http to keep from receiving a warning if and when you use a SSL Certificate

<script type="text/javascript" src="[B]http:[/B]//apis.google.com/js/plusone.js"></script>

Folloe the overrides system and place in a copy for your template of html_header.php

The second part of the code is to be added to the body
In a copy of tpl_main_page.php

Alternates might be to tpl_footer.php

Zen-Venom Get Bitten

4 Jun 2011, 7:24 AM
#3
rockmellon avatar

rockmellon

New Zenner

Join Date:
Sep 2009
Posts:
19
Plugin Contributions:
0

Re: Google Plus 1

Thank you kobra.

I don't have a html_header.php in my overrides. Do I just copy the html_header.php from includes/templates/template_default/ to my custom templates/common/ folder and then edit it?

Also could I put the part of the code that goes in the body in a sidebox?

Thank you for the tip on the https instead of http

4 Jun 2011, 7:41 AM
#4
rockmellon avatar

rockmellon

New Zenner

Join Date:
Sep 2009
Posts:
19
Plugin Contributions:
0

Re: Google Plus 1

Thanks Kobra.

the google plus 1 in now on my site in a sidebox.

Thank you for your help very much!

8 Jun 2011, 9:46 AM
#5
phil99 avatar

phil99

Zen Follower

Join Date:
Aug 2007
Posts:
113
Plugin Contributions:
0

Re: Google Plus 1

Hi guys,

So is it ok to change the google url to https? Like you say it gives a warning otherwise.

I can get the google plusone button to show in a side box on every page apart from my product pages, where it will not show.

I am using the SEO URL module, could this be effecting it?

8 Jun 2011, 9:50 AM
#6
rockmellon avatar

rockmellon

New Zenner

Join Date:
Sep 2009
Posts:
19
Plugin Contributions:
0

Re: Google Plus 1

phil99:

Hi guys,

So is it ok to change the google url to https? Like you say it gives a warning otherwise.

I can get the google plusone button to show in a side box on every page apart from my product pages, where it will not show.

I am using the SEO URL module, could this be effecting it?

The https is correct. I did a test order and I've had about 4 or 5 additional orders and no warnings have been given.

Sorry I can't hlep you with the SEO URL mod as I've never used it.

8 Jun 2011, 10:13 AM
#7
phil99 avatar

phil99

Zen Follower

Join Date:
Aug 2007
Posts:
113
Plugin Contributions:
0

Re: Google Plus 1

Hi there,

thanks,

Yes I am using the Ultimate SEO URLs mod, and the plusone box works everywhere except my product pages.... I have tried adding the href attribute to the plusone link but they just wont show....

Any ideas would be appreciated!

13 Jun 2011, 2:56 PM
#8
phil99 avatar

phil99

Zen Follower

Join Date:
Aug 2007
Posts:
113
Plugin Contributions:
0

Re: Google Plus 1

If anyone is interested I have managed to find that it was the Zen Lightbox module I had installed. The javascript called in the header for the light box, stops the plusone button rendering....

Any ideas why or how? I now have lightbox turned off, but I did like it and would like both.

13 Jun 2011, 5:53 PM
#9
blessisaacola avatar

blessisaacola

Totally Zenned

Join Date:
Feb 2004
Location:
Georgia, USA
Posts:
1,875
Plugin Contributions:
1

Re: Google Plus 1

phil99:

If anyone is interested I have managed to find that it was the Zen Lightbox module I had installed. The javascript called in the header for the light box, stops the plusone button rendering....

Any ideas why or how? I now have lightbox turned off, but I did like it and would like both.

This FAQ might help with with regards to positioning the script with other script on your site: http://code.google.com/apis/+1button/#faqs

13 Jun 2011, 5:55 PM
#10
blessisaacola avatar

blessisaacola

Totally Zenned

Join Date:
Feb 2004
Location:
Georgia, USA
Posts:
1,875
Plugin Contributions:
1

Re: Google Plus 1

rockmellon:

Thanks Kobra.

the google plus 1 in now on my site in a sidebox.

Thank you for your help very much! Can you please post a url to your site or PM it to me. I want to see how this is working on your site. I was getting security warning on our site so I have temporarily disabled Google Plus 1.

Thanks!

14 Jun 2011, 11:52 AM
#11
phil99 avatar

phil99

Zen Follower

Join Date:
Aug 2007
Posts:
113
Plugin Contributions:
0

Re: Google Plus 1

Google have updated and changed their code since releasing the button. They now suggest you must call https (this will stop your security warning) and also position the code no longer in the header but at the end of the body just before </body>

The problem I have now is that the button only works when the pages are SSL... if the URL is https then the button works perfectly, otherwise if its http I get the red error button.

Is the code in an SSL page different from a non? That would make the button work or not?

I have spent 5 days on this now, just at a complete blank.

My site is https://www.classicmoviestore.co.uk

14 Jun 2011, 2:41 PM
#12
blessisaacola avatar

blessisaacola

Totally Zenned

Join Date:
Feb 2004
Location:
Georgia, USA
Posts:
1,875
Plugin Contributions:
1

Re: Google Plus 1

Well, this is exactly the issue, we were displaying the button on product page which is non-ssl but the button is being called from ssl page which is throwing errors. It will make sense if the page the button is on is ssl to call the script from https and if it's non-ssl to use the http. Really don't know what's the big deal while Google feels the need to call it from https when most site will probably display the Google Plus 1 button on non-ssl pages.

15 Jun 2011, 11:07 AM
#13
phil99 avatar

phil99

Zen Follower

Join Date:
Aug 2007
Posts:
113
Plugin Contributions:
0

Re: Google Plus 1

I am somewhat confused by 'calling the script from https'.

Does that mean you can only put the button on https pages? Or you have to call/download the script from their https url?

Im sure other websites have the plusone button on non secure pages?

15 Jun 2011, 2:16 PM
#14
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

Re: Google Plus 1

If I were me, I'd give +1 a pass for a few more weeks while others work out the bugs and implications. I'm never an early adopter, and I think you're finding out why. :frusty:

Rob

Breakfast: the most important donut of the day.

15 Nov 2011, 7:30 PM
#15
art75 avatar

art75

New Zenner

Join Date:
Aug 2010
Posts:
12
Plugin Contributions:
0

Re: Google Plus 1

Hi Rockmellon

I don't have a html_header.php in my overrides either.
What should I do to put both parts of script in correct places ?

regards :D

15 Nov 2011, 8:36 PM
#16
rescoccc avatar

rescoccc

Totally Zenned

Join Date:
May 2010
Location:
WA State
Posts:
1,700
Plugin Contributions:
2

Re: Google Plus 1

art75:

Hi Rockmellon

I don't have a html_header.php in my overrides either.
What should I do to put both parts of script in correct places ?

regards :D

You need to put the html_header.php file in your overrides folder - includes/templates/your_template/common. IF that's where you want to put the call script. I put it as the last entry of includes/templates/your_template/common/tpl_main_page.php. The reason I put it there rather than the header is because I have a couple other js calls in the header and the Plus One wasn't working.

So, in summary. Put <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script> in whichever file where it works. And, put the <g:plusone></g:plusone> button code where you want the button to appear. I have it on my index page at the bottom, and also on my product pages.

The best way to learn is to try stuff. But, back it up first.

24 Nov 2011, 1:19 AM
#17
art75 avatar

art75

New Zenner

Join Date:
Aug 2010
Posts:
12
Plugin Contributions:
0

Re: Google Plus 1

Thanks very much :smile:
Will try it soon.
Artur

27 Nov 2011, 9:24 PM
#19
art75 avatar

art75

New Zenner

Join Date:
Aug 2010
Posts:
12
Plugin Contributions:
0

Re: Google Plus 1

It works :)
I finally put Google code in these files:

located in: /includes/templates/---my template---/common

  1. tpl_main_page
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
  1. tpl_footer

<g:plusone></g:plusone>

Thanks again !
Artur

26 Dec 2011, 2:48 PM
#20
serious avatar

serious

Totally Zenned

Join Date:
Feb 2011
Posts:
686
Plugin Contributions:
0

Re: Google Plus 1

So where in the html_header.php do I add the required script?