Google Analytics breaks iWeb blog comments

Does anybody know a workaround for Google Analytics' breaking of iWeb blog comments? Apparently, from some posts I've read, StatCounter and other traffic stat services break iWeb blog comments, too... so it's apparently an iWeb issue rather than a Google Analytics issue. FWIW, I'm publishing to my MobileMe personal domain. Thanks in advance!

I found a decent way of adding Google Analytics to all pages, without using HTML Snippits (which cause analytics to track those odd page names like widget2_markup.html), that doesn't break MobileMe comments, and doesn't require any post-processing of your iWeb site. Just Publish and go! Open up your iWeb app bundle, and drill down to Contents/Resources/Scripts/Site. Open up the file iWebSite.js in TextEdit (or your favorite text editor), and paste the following at the bottom of the file:
// Begin Google Analytics
gaTrackerId = 'ss-ddddddd-d'; // insert your tracker id here
document.observe('dom:loaded', function() {
var gaJsHost = ( ('https:' == document.location.protocol) ? 'https://ssl.' : 'http://www.') + 'google-analytics.com/ga.js';
var script = new Element('script', { 'src': gaJsHost});
var gaTrack = function() {
if (
!script.readyState
|| /loaded|complete/.test(script.readyState)
var pageTracker = gat.getTracker(gaTrackerId);
pageTracker._trackPageview();
script.observe('load', gaTrack);
script.observe('readystatechange', gaTrack);
document.body.appendChild(script);
// End Google Analytics
Credit to this solution goes to this blog post. I got the idea to find a way of using Google Analytics in Prototype (since iWeb sites use the Prototype JavaScript framework) and found that blog snippit.
And yes, since this is editing the iWeb application bundle, you may need to reapply this hack if/when iWeb is updated. Hopefully though, some enterprising iWeb engineer is reading this and will add proper Google Analytics support to iWeb for us.

Similar Messages

  • Google Analytics Automator breaks iWeb blog comments

    Hi
    I added a blog for our Small Business site that I created with iWeb. We used Google Analytics and the Automator script add the HTML snippet to track visits on our site. Since I added the blog I realized that after running the GA automator script the "Add a comment" link disappears.
    Kinda defeats the purpose of the blog. I have to choose between tracking how many visitors have been on the blog, or visitors posting comments, but I can't have both. How can I fix this and track how many visitors were on our site, and have a blog where visitors can leave comments? Any ideas and solutions would be most welcome. Thanks,
    Zoltan

    Unfortunately, as you have discovered, inserting Google Analytics into your site requires post editing. This means that you cannot just publish directly to MobileMe from iWeb - to insert the analytics you need to publish to a folder, insert and then place the Blog directly on your iDisk - unfortunately, this way you loose the features that your iWeb blog provides when published directly to MME - i.e. Blog comments.
    Do you have an ordinary website too or is it just a blog? If you have an ordinary website, what some people do, including myself, is set up a blog with WordPress, E-blogger, or http://www.posterous.com and link to it from your iWeb site.
    If you are just after setting up a blog on its own without a site, then I would suggest you look at http://www.wordpress.com, http://www.eblogger.com or posterous (link provided). You can set up a blog with any template you like and can add entries on line at any time, rather than being limited to updating with the domain.sites file as you are with iWeb.
    In WordPress, you can also add as many pages as you like, so you can effectively have a website as well as a blog, so the other alternatives might be a better bet than iWeb and I think they have their own built in analytics too.

  • Google analytics breaks youtube movies

    Hi,
    I have a couple of youtube videos on my website, but after starting using Google analytics, adding it with an automator action, the youtube videos does not show up on my site, only a blank space.
    Anyone know how to solve this?

    I found a decent way of adding Google Analytics to all pages, without using HTML Snippits (which cause analytics to track those odd page names like widget2_markup.html), that doesn't break MobileMe comments, and doesn't require any post-processing of your iWeb site. Just Publish and go! Open up your iWeb app bundle, and drill down to Contents/Resources/Scripts/Site. Open up the file iWebSite.js in TextEdit (or your favorite text editor), and paste the following at the bottom of the file:
    // Begin Google Analytics
    gaTrackerId = 'ss-ddddddd-d'; // insert your tracker id here
    document.observe('dom:loaded', function() {
    var gaJsHost = ( ('https:' == document.location.protocol) ? 'https://ssl.' : 'http://www.') + 'google-analytics.com/ga.js';
    var script = new Element('script', { 'src': gaJsHost});
    var gaTrack = function() {
    if (
    !script.readyState
    || /loaded|complete/.test(script.readyState)
    var pageTracker = gat.getTracker(gaTrackerId);
    pageTracker._trackPageview();
    script.observe('load', gaTrack);
    script.observe('readystatechange', gaTrack);
    document.body.appendChild(script);
    // End Google Analytics
    Credit to this solution goes to this blog post. I got the idea to find a way of using Google Analytics in Prototype (since iWeb sites use the Prototype JavaScript framework) and found that blog snippit.
    And yes, since this is editing the iWeb application bundle, you may need to reapply this hack if/when iWeb is updated. Hopefully though, some enterprising iWeb engineer is reading this and will add proper Google Analytics support to iWeb for us.

  • Google Analytics in iWeb (continued thread from 'Anchor Tabs in iWeb')

    Cyclosaurus wrote:
    --it's more precise than widget placement (if you add text the y-axis placemnt will change of course screwing up the entire alignment, which is why this royally screwed up without built-in anchor tags)
    I'm glad you got it.
    I have a precise method for within page anchors but it is too abstract for people here, so I toned it down with javascript scroll function... and yet, people still don't understand it.
    The method dynamically set/changes both source and destination of the anchors during the page load. The trick is how to set the anchors in iWeb Inspector.
    Yes, I was impressed with the utlization of the array and for loop to create the references for xyz number of links. The code could've been more bloated, but yours was efficient. I have reverence for your code's efficiency and functionality.
    That said, as of iweb3... I can build my own widgets to deal with common things like this. I'd built much more complicated widgets than just within page anchors. Have a look at my page:
    http://home.cyclosaurus.com/UnderConstruction.html
    I've tinkered wtih C, Java, and Javascript enough to appreciate good code. I am not interested in devoting more time to coding (my emphasis is NLP now), so I can't go into more depth with this, but needless to say, I was impressed with how concise, functional (non-buggy), and intuitive your javacript snippet was.
    the "_anchors" variable seems to be handled really well and you set it up for cross-browser platforms (// http:/ == Safari , http:/// == EI7 and FF).
    I may scrutinze this more to further my understanding of arrays. This is an article I wrote on arrays during a computer science class in college.
    In any case. Clean codekid. quality!
    Lastly, I have total control over every widget that I add on my page... I don't have to guess which widget# iweb assigned.
    Yes, control definitely is the ultimate result to clean, efficient, functional (non-buggy code). I'm working on a set of principles for social, outside, phone, email, physiology, inside, etc that is "Code" for success. It's very complex and needs to have efficiency, functionality, and cleanliness and concision. OKay. cheers.
    "Big Brother (aka apple)" HHAHAAH!!!! I love apple! apple computer isn't THAT controlling, but it's true, some things it's hard to have control of with apple (photo booth save folder is the most recent lol). I'll never use microsfot product again (enormous waste of time and moving backwards in life). so long live apple.
    GOOGLE ANALYTICS and your STATCOUNTER code. !!!!!!! I'm in the process of needing to set those up on my site. Did you do that efficiently? Do you recommended any widgets??? I have numerous statcounter projects, but need to get it up on my main site. Do you put statcounter html on every page of your site? is that necessary? Do you need to put a google analytics on every page of your site?? Thanks heaps. (this is probably a seperate thread now). Should we start this as a new thread?
    I've bookmarked Cyclo's and Toadie's site for thei helpfulness in the future working with iweb.
    Message was edited by: johntkucz
    Message was edited by: johntkucz
    Macbook 2.16 (White) Mac OS X (10.5.5) 8gb 1st Gen iPhone; 3.06ghz 24" iMac.
    johntkucz
    Posts: 90
    From: Los Angeles
    Registered: Jun 29, 2008
    Re: Anchor Tags in iWeb
    Posted: Jun 6, 2009 5:46 PM in response to: johntkucz
    Reply Email
    Should this be another thread? I think so. The subject has now evolved from anchor tags to analytics and other widgets! lol
    Do you host your site on mobileme or 3rd-party? I'm currently using godaddy and everyone has their preference. Regardless of which 3rd-party used, the '09 iweb ability to auto publish to ftp server is extremely handy for quickly checking to see if code/updates/changes made in iweb look and behave the way they're supposed to behave in browsers.

    "Big Brother (aka apple)" HHAHAAH!!!! I love apple! apple computer isn't THAT controlling, but it's true, some things it's hard to have control of with apple (photo booth save folder is the most recent lol). I'll never use microsfot product again (enormous waste of time and moving backwards in life). so long live apple.
    I did not mean to be a joke, I'm serious about it.
    apple have poked at my site for some of the stuff that I'm doing.
    Not just a controlling big brother... but thieves, they'd ripped off my works.
    GOOGLE ANALYTICS and your STATCOUNTER code. !!!!!!! I'm in the process of needing to set those up on my site. Did you do that efficiently?
    AFAIK I'm the only one (as now) build widgets that *actually work* with iweb3.
    So there is nothing for me to compare with, to know if I do efficient works (in iweb3 context).
    Do you recommended any widgets???
    No. I do look at other widgets to see how they work and how efficient they are...
    But I don't use them, I build my own iweb widgets.
    I have numerous statcounter projects, but need to get it up on my main site. Do you put statcounter html on every page of your site? is that necessary? Do you need to put a google analytics on every page of your site?? Thanks heaps. (this is probably a seperate thread now).
    It's all depend.
    As far as I see so far, people (most of iweb users) add GA and Statcounter thru HTML Snippet...
    But they don't realize that by doing so the codes don't track correctly.

  • Want to use google analytics in iweb. Possible?

    i transfered domain to .mac and had to convert site to iweb 08 from dreamweaver. is there anyway to continue using google analytics? google webmaster tools? insert any code? adsense seems to work but google informs me apple will share the profits!
    are there any web analytics tools native to iweb?

    Shiels,
    try the AddGoogleAnalytics automator script from here: <http://www.apple.com/downloads/macosx/automator/addgoogleanalyticsaction.html>
    Works fine for me. Even more, Henrik is very helpful in case of problems.
    Regards,
    Kai

  • Does iWeb blogging (comments, etc.) only work when published to .Mac?

    The subject says it all, but I was wondering how well the blog features of iWeb work when publishing to a non-.Mac host.
    Right now I use WordPress for my blog. Is iWeb's blog feature a reasonable alternative?
    doug

    The iWeb features which are .Mac only are: Direct one-step uploading, Password protection, Hit counter, Slideshow with viewing controls, and Blog Comments/Searching.

  • Using Google Analytics with iWeb site

    Is it possible to use Google Analytics with an iWeb site? They have code they want me to put before the </body> tag.... and I can't find that tag. How do I get the code to show in iWeb? Can I insert this with an HTML snippet?
    Thanks!

    Hello ruralart,
    After saving the automator workflow as a Finder Plugin,
    mount you iDisk in the finder (ex. click on the iDisk icon in the left pane of a Finder window),
    goto the folder iDisk / Web / Sites , select this folder "sites",
    control-click on the folder to run the “Add Google Analytics” workflow.
    Note : when you have iDisk Sync = ON, you'll see that the folder "web" is an alias so Automator will not work in this situation. You'll have to turn iDisk Sync OFF.
    Kind regards,
    Leo

  • Google Analytics for iWeb

    Please help.. I am trying to get google analytics (or anything like that) onto my iWeb site so I can see how many people view it and from where...does anyone know how to do this? I tried to google it.. and I just got even more confused... THANKS!!!

    I assume you searched this forum and couldn't find anything?
    [google analytics|http://discussions.apple.com/search.jspa?objID=c188&search=Go&q=google+analytics]
    I found this : [Setting up Google Analytics|http://discussions.apple.com/thread.jspa?messageID=11748928&#11748928 ]

  • Google Analytics and iWeb

    I'm attempting to insert an html tag generated by Google Analytics into our website that is published using iWeb (the latest version, sorry, I'm no longer on site).  Can anyone help me?
    Thank you,
    Jeff

    Since this is your website, the path to the analytics.js file is not correct :
    http://www2.hawaii.edu/~kpauker/Pauker_Lab/People.html
    The line in the code where it says :
    newScript.src = '/js/analytics.js';
    should be in order of preference :
    newScript.src = '../../../js/analytics.js';
    Or :
    newScript.src = '/~kpauker/js/analytics.js';
    Or :
    newScript.src = 'http://www2.hawaii.edu/~kpauker/js/analytics.js';

  • Iweb blog comments

    Hi people,
    Could somebody help me?
    i have published my site at www.dubkasm.com and used a blog page as a comments book, only when i publish the site there is no section like 'add comment' or 'post message'. How can i do this? Any help much appreciated!
    Cheers,
    Ben (Brazil)

    Try searching the forum as this has been covered before.
    As far as I can remeber Blog comments created through iWeb are stored server side on .Mac somewhere, so exporting your site to another domain, other than .Mac, will make comments inactive.

  • Google Analytics for iweb 09 site published to MobileMe

    At one point I was able to add Google Analytics to my iweb site that's on Mobile Me. That lasted 2 days, till I republished it. I redid it twice, I thought the same way. The last time was yesterday after changing to new iweb 09 software. I published site to local disk (idisk), then went to Automator and added the Google Analytics code (UA-xxxxxxx-x) again and unchecked "Old Style Analytics Code". I saved as a new "Google Analytics plugin". Then I selected website folder on idisk through Finder. Then control-clicked (to run Google Analytics workflow) and chose the "Google Analytics plugin" from menu. After this, I went back to my site in iweb and clicked on "Publish". I assumed that it published the site in idisk, where I had added Google Analytics. But it's been over 24 hours and no results in Google Analytics.
    Through Safari, I went to home page of site, then clicked View, then page source and I don't see the Google Analytics code (UA-xxxxxxx-x) shown so it didn't seem to work. I just don't know where I made a mistake. I don't think its because I changed to iweb 09 because I re-did it the same way in iweb 08 (but did not uncheck the "Old Style Analytics Code") and it didn't work then either. Can't figure out how I got it to work for two days when I first tried it.
    Please help. Anyone?

    It is now easier than ever. You don't need an outside application, or an automator action at all. I used to use Transmit to upload my site, since I first had to export it to a folder, then run the automator action. I again spent some time looking for how to do it for iWeb 09 and found the easiest (and therefore overlooked) way:
    1. in iWeb, create an HTML snippet
    2. Copy the Google Analytics code and paste into the snippet.
    3. Make the box as small as it can go (although this does not really matter since nothing will display on your site)
    4. Copy this snippet and go on each page on your site and paste it.
    5. Publish your site.
    6. It will take a little bit of time for it to show up on the Google Analyics page, so set it up, then walk aawy for a little bit.
    This worked for me right away, and I no longer have to export to a folder and use an action of any kind.

  • Problem with iWeb SEO breaking iWeb blogs (Blog Summary Widget error).

    As as happened to many others, my blog was broken. The only thing that showed up when publishing was "Blog Summary Widget", no actual blog.
    I came on here and searched, uninstalled with apzapper, deleted preferences before that, tried everything.
    Still the problem.
    Then I notice my blog works. I'm excited. I move on in my post iweb part of the process (iWeb SEO and dreamweaver edits) to then see it's broken again.
    After some testing (changing 1 file at a time, one step at a time) I found that when iWeb SEO touched the home.html (where my blog is) it broke it.
    This is a new phenomenon as I was doing this all the time before with no problem.
    I even tried updating to the latest version of iWeb SEO and the same problem.
    So if you're having this problem, and are using iWeb SEO, try it without and see if you still have the same problem.

    I'm getting the same problem too. I've just updated my iWeb from 1 to 2. I've had to more or less re-create my Blog from scratch as the upgrade wrecked the summary and recent items pages (probably because I'd use jTemplate).
    So I created a new Site, dragged the old blog over to it and created a brand new one in my proper site. I then copied all my formatting over AND all the entries. All looks fine in iWeb, but I see the same error messages as described here. Take a look here : http://www.andrewmay.biz/test/
    Obviously I've moved a lot of stuff around from the normal White template, and deleted a few things too, but I would have hoped that iWeb wouldn't let me trash things that then broke it.

  • Loading google analytics on iweb

    I set up my GA account copied the code set it in a html snippet hit applied and published my site.
    I am still not connecting with GA and it is telling mw it is not installed.
    any help would be greatly appreciated.

    Welcome to the Apple Discussions. If you are publishing your site to MobileMe you can useiWeb SEO Tool to make the edits on the iDisk server instead of publishing to a folder and then uploading. It's a bit slower but avoids the extra step of local publishing.
    OT

  • Data tracking with Google Analytics

    Hi
    Can I use Google Analytics with iweb?

    Yes. You can add it to each page using iWeb SEO which requires it to be reapplied each time you edit a page.
    You can also add it an HTML snippet which is a one time application. However, the snippet requires a bit more effort up front. Wyodor posted detailed instructions on how: IWEB : ADDING GOOGLE ANALYTICS WITHOUT EDITING THE WEBPAGE.
    Have you looked at the information that you can get about visitors by using a counter from StatCounter.com. It's quite comprehensive and much easier to add to each page.
    Click to view full size
    Old Toad's Tutorial #13 - Adding a StatCounter as an HTML Snippet describes how to add the counter.
    I've used both and find the info from StatCounter more complete regarding visitors.
    OT

  • Google Analytics & Personal Domain Set Up

    Hello,
    I want to set up Google Analytics for iWeb. I have a personal domain set up through .mac.
    My question is when I log into Google Analytics to sign up it ask for a URL. Which one do I give? My personal one?
    Thanks,
    Luke

    If your site is hosted on .Mac then you will find that your personal domain is just rerouted to your .Mac
    As nothing will be held on your personal domain there will be nothing for google to search for. You will have to route it to http://web.mac.com/yourusernamehere/ address.
    IE; For my website: http://www.jamiejonesphoto.com
    I would need to give the URL as: http://web.mac.com/jamie_jones/
    But doe the Default Address you will need to give it the full address of what ever your front/home/opening page is. For me that would be: http://web.mac.com/jamie_jones/Site/Home.html
    I hope that helps.
    Jamie

Maybe you are looking for