Sha256: dfa97fa44f7132f07ac95ed3bdbbff5bfcb6f779d718ba5ee3abdb0f759648c2

Contents?: true

Size: 1.09 KB

Versions: 127

Compression:

Stored size: 1.09 KB

Contents

<%@ page import="java.io.UnsupportedEncodingException,
                 java.net.URLEncoder" %>
<%!
  // Copyright 2009 Google Inc. All Rights Reserved.
  private static final String GA_ACCOUNT = "ACCOUNT ID GOES HERE";
  private static final String GA_PIXEL = "ga.jsp";

  private String googleAnalyticsGetImageUrl(
      HttpServletRequest request) throws UnsupportedEncodingException {
    StringBuilder url = new StringBuilder();
    url.append(GA_PIXEL + "?");
    url.append("utmac=").append(GA_ACCOUNT);
    url.append("&utmn=").append(Integer.toString((int) (Math.random() * 0x7fffffff)));

    String referer = request.getHeader("referer");
    String query = request.getQueryString();
    String path = request.getRequestURI();

    if (referer == null || "".equals(referer)) {
      referer = "-";
    }
    url.append("&utmr=").append(URLEncoder.encode(referer, "UTF-8"));

    if (path != null) {
      if (query != null) {
        path += "?" + query;
      }
      url.append("&utmp=").append(URLEncoder.encode(path, "UTF-8"));
    }

    url.append("&guid=ON");

    return url.toString();
  }
%>

Version data entries

127 entries across 127 versions & 5 rubygems

Version Path
middleman-core-3.4.1 lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/jsp1.snippet
middleman-core-3.4.0 lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/jsp1.snippet
middleman-core-3.3.12 lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/jsp1.snippet
middleman-core-3.3.11 lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/jsp1.snippet
middleman-core-3.3.10 lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/jsp1.snippet
middleman-core-3.3.9 lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/jsp1.snippet
middleman-core-3.3.8 lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/jsp1.snippet
middleman-core-3.3.7 lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/jsp1.snippet
middleman-core-3.3.6 lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/jsp1.snippet
middleman-core-3.3.5 lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/jsp1.snippet
middleman-core-cj-3.3.6 lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/jsp1.snippet
middleman-core-cj-3.3.5 lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/jsp1.snippet
middleman-core-cj-3.3.4 lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/jsp1.snippet
middleman-core-3.3.4 lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/jsp1.snippet
middleman-core-3.3.3 lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/jsp1.snippet
middleman-core-3.3.2 lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/jsp1.snippet
middleman-core-3.3.1 lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/jsp1.snippet
middleman-core-3.3.0 lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/jsp1.snippet
middleman-core-3.2.2 lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/jsp1.snippet
middleman-core-3.2.1 lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/jsp1.snippet