The Turning Gate

Adobe Lightroom Web Engines, Tutorials and Resources

Google Analytics, Disable Right-click in TTG Highslide Gallery

by theturninggate on June 6, 2009

By popular request, TTG Highslide Gallery 1.1 adds support for Google Analytics. As implemented, however, the feature can be put to other uses as well. For example, it can be used to insert script that disables the browser’s right-click menu. This brief tutorial will show you how to make use of this new feature.

What does it do, exactly?

There is nothing inherently Google about the gallery’s “support” for Google Analytics. The feature merely provides an entry field into which a block of code can be dropped into the gallery page immediately preceding the </body> tag. This just so happens to be where the Google Analytics code is supposed to go.

It’s also where a number of other scripts could possibly go …

Installing Google Analytics

This is a two-step process.

1. Visit Google Analytics. Copy your tracking code.

googleanalytics

2. Paste the tracking code into Lightroom.

googleanalytics

That done, you’re done. Export the gallery at your leisure. Allow up to 24 hours for Google to collect statistics for display.

Abuse It

Some users have lamented TTG Highslide Gallery’s lack of a “Disable Right-click” feature. I’ll be honest with you: I hate this “feature”. In general, scripts that interfere with a browser’s innate behavior are kind of uncool. Moreover, it’s a pain in the posterior when I’m called upon to troubleshoot someone’s gallery, only to find they’ve hindered my all important right-clickiness. Furthermore, it’s a protective measure easily circumvented by disabling Javascript in my browser. To wit, the “feature” is pointless and bothersome.

But because some people still like it, I will climb down from my soap box for a moment and give it to you.

Understand, however, that Disable Right-click is not a feature of TTG Highslide Gallery, falls squarely into the realm of hacks, and is therefore not supported. I will not be held responsible for any problems that may ensue from using it. I will not answer questions about it. I will not troubleshoot it for you. If you ask me to troubleshoot a problematic gallery and I find the right-click disabled, I will just ask you to create a new gallery without it before I will help you.

Right here, right now is the ONLY time I will ever offer any advice about disabling the right-click. Take it or leave it, but I reserve the right to be adamantly rude, obstinately obstinate and unnecessarily loquacious on this topic.

Are we clear?

Now, if you still really want to do this, you can find the script here. Select All, Copy and Paste the script into the entry field for the Google Analytics code in TTG Highslide Gallery. Export your gallery and you should find your right-clicks blocked by the script.

If you’d like, you can copy multiple scripts into the field. You could, for example, paste both the Google Analytics tracking code and the disable right-click script into the box together and run with scissors both. Of course, I do not advocate doing this, for all of the aforementioned reasons I hate the latter script.

You know how Golem feels about Hobbits? Multiply that by 100, and you will be close to understanding how I feel about disabling the right-click.

I will now take my soap box and walk away.

{ 6 comments… read them below or add one }

Ryan Smith March 10, 2010 at 10:56 am

I just wanted to comment on this because maybe you don’t understand why some of us want this exactly. Any pictures on the internet can be copied by a simple print screen, there is no protection in reality. However most users of my gallery are really not sophisticated, they are not going to know how to disable javascript. I just want a little something in there to make it harder to save an image from their proofs than just a right click. It’s not quite as bad wanting to disable the right click as you make it sound.

Reply

André July 7, 2010 at 5:14 pm

I’m using Mouse-gestures (like many other people) to navigate my way through websites, because it makes navigating much faster. Most Mouse-gestures are activated using the Right-click. If a website disables the Right-click and displays an annoying message everytime I want to draw a mouse gesture, I cannot use them anymore. In my opinion it’s a lack of respect, if the webmaster forces me to disable javascript in order to be able to use his website correctly.

Therefore I usually leave the website immediately if it disables the Right-click.

Reply

theturninggate July 7, 2010 at 5:21 pm

I agree with you. I hate disabled mouse-clicks.

Reply

Ryan Smith July 7, 2010 at 6:01 pm

No one is saying right clicks should be disabled for entire websites. But if you want to be a client of mine and look at your proofs you just have to put up with it. I doubt anyone has even noticed. If you know how to disable javascript, the right click code isn’t there to stop you. Just discourage easy image saving from client galleries from the majority of users. I like to put up pretty high resolution proofs, so I’d rather clients not save images directly until I provide a CD for them.

Reply

André July 8, 2010 at 9:00 am

I agree with you. If none of your clients have basic knowledge about web-technology, it might prevent them from saving the pictures.

But if I was your client, I would get the feeling that you think I’m stupid. And just for the fun of prooving you wrong, I might feel challenged to use a web-spider to download your complete site including all of your pictures with just “one click”.

Of course this doesen’t apply to your regular customers, I know.

Reply

Ryan Smith July 8, 2010 at 9:46 am

If you really want to get a bunch of peoples wedding and family pictures go ahead and download my site. You do realize that 99.9% of people have no idea what we are talking about, someone isn’t stupid because they don’t know what javascript is. As I said the right click disabling is not to protect my content.

Leave a Comment


Previous post:

Next post: