Skip to main content
Sean McCormack
Community Expert
Community Expert
January 21, 2009
Question

[Web] Adding Google Analytics to a page via f:labled_text_input

  • January 21, 2009
  • 3 replies
  • 1302 views
I know we got the extension from 150 chars in LR2.2, but now I'm faced with a silly, annoying issue. Here's my code (yes the code is fine- in fact it's a good example of conditional coding for anyone who cares IMHO) <br /> <br />Model <br /> ["nonCSS.useAnalytics"] = false, <br /> ["nonCSS.Analytics"] = "", <br /> <br />Views (labels section) <br /> <br />f:subdivided_sections { <br /> f:header_section_label { <br /> title = "Google Analytics Code", <br /> }, <br /> f:content_column { <br /> f:checkbox_row { <br /> title = "Insert Analytics Code", <br /> bindingValue = "nonCSS.useAnalytics", <br /> }, <br /> }, <br /> f:labeled_text_input { <br /> title = "Paste Anaytics Code", <br /> value = bind "nonCSS.Analytics", <br /> }, <br /> <br /> <br /> }, <br /> <br />HTML <br /> <br /><% if model.nonCSS.useAnalytics then %> $model.nonCSS.Analytics <% else %><% end %> <br /> <br />The code works fine except that when you paste the Google Analytics code into the "Paste Analytics Code" textbox, it opens the ga.js code in a browser window. It's rather annoying. <br /> <br />Is there a way to suppress the page opening?
This topic has been closed for replies.

3 replies

Sean McCormack
Community Expert
Community Expert
April 1, 2009
I've already changed how I do it since then. Now you just add the Analytics ID, rather than pasting the code. I'll peek at your post though.
Sean McCormack. Author of 'Essential Development 3'. Magazine Writer. Former Official Fuji X-Photographer.
Participant
April 1, 2009
I'd also like to avoid opening the ga.js code! That has been annoying me for a long time :-P

I just wrote how to (not very elegantly) add Google Analytics code to the default HTML template, in case anyone's interested:

http://automagisk.no/blog/2009/04/01/adding-google-analytics-to-lightroom-web-template/
Sean McCormack
Community Expert
Community Expert
January 25, 2009
No is a valid answer, folks.. Any one any idea?

I remember back with XSLT galleries that Lightroom also would open online image sources in the browser. Relative links fixed this, but it's not doable here AFAIK.
Sean McCormack. Author of 'Essential Development 3'. Magazine Writer. Former Official Fuji X-Photographer.