Sha256: 5885609d8ebf9589f03c008c76dd4cba73f846b182700d3289ebd4ce9da283aa

Contents?: true

Size: 1.47 KB

Versions: 127

Compression:

Stored size: 1.47 KB

Contents

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page import="java.io.UnsupportedEncodingException,
                 java.net.URLEncoder" %>
<%!
  private static final String GA_ACCOUNT = "MO-3845491-5";
  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();
  }
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Sample Mobile Analytics Page</title>
</head>
<body>

Publishers content here.
<%
  String googleAnalyticsImageUrl = googleAnalyticsGetImageUrl(request);
%>
<img src="<%= googleAnalyticsImageUrl %>" />
Testing: <%= googleAnalyticsImageUrl %>
</body>
</html>

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/sample.jsp
middleman-core-3.4.0 lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/sample.jsp
middleman-core-3.3.12 lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/sample.jsp
middleman-core-3.3.11 lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/sample.jsp
middleman-core-3.3.10 lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/sample.jsp
middleman-core-3.3.9 lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/sample.jsp
middleman-core-3.3.8 lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/sample.jsp
middleman-core-3.3.7 lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/sample.jsp
middleman-core-3.3.6 lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/sample.jsp
middleman-core-3.3.5 lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/sample.jsp
middleman-core-cj-3.3.6 lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/sample.jsp
middleman-core-cj-3.3.5 lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/sample.jsp
middleman-core-cj-3.3.4 lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/sample.jsp
middleman-core-3.3.4 lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/sample.jsp
middleman-core-3.3.3 lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/sample.jsp
middleman-core-3.3.2 lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/sample.jsp
middleman-core-3.3.1 lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/sample.jsp
middleman-core-3.3.0 lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/sample.jsp
middleman-core-3.2.2 lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/sample.jsp
middleman-core-3.2.1 lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/sample.jsp