Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   * The MIT License (MIT)
   * Copyright (c) 2015 Erik Beeson
   * Permission is hereby granted, free of charge, to any person obtaining a copy
   * of this software and associated documentation files (the "Software"), to deal
   * in the Software without restriction, including without limitation the rights
   * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  * copies of the Software, and to permit persons to whom the Software is
  * furnished to do so, subject to the following conditions:
  * The above copyright notice and this permission notice shall be included in all
  * copies or substantial portions of the Software.
 package com.erikandcolleen.gacookieparser;
 import java.util.Date;

Visitor (__utma) This cookie is typically written to the browser upon the first visit to your site from that web browser. If the cookie has been deleted by the browser operator, and the browser subsequently visits your site, a new __utma cookie is written with a different unique ID. In most cases, this cookie is used to determine unique visitors to your site and it is updated with each page view. Additionally, this cookie is provided with a unique ID that Google Analytics uses to ensure both the validity and accessibility of the cookie as an extra security measure.

Erik Beeson
 public class GAVisitorData extends GADataBase {
 	public static final String COOKIE_NAME = "__utma";
 	private final String uid;
 	private final Date firstSessionStart;
 	private final Date previousSessionStart;
 	private final Date currentSessionStart;
 	private final Integer sessionCount;
 	public GAVisitorData(String value) {
 		this. = getString(1);
 		this. = getInteger(5);

Unique Identifier.
 	public String getUid() {
 		return ;

Timestamp of this user's first session.
 	public Date getFirstSessionStart() {

Timestamp for the previous session.

Timestamp for the current session.

Number of sessions started.
 	public Integer getSessionCount() {
 		return ;
 	public String toString() {
 		final StringBuilder sb = new StringBuilder("GAVisitorData{");
 		sb.append(", uid='").append().append('\'');
 		sb.append(", firstSessionStart=").append();
 		sb.append(", previousSessionStart=").append();
		sb.append(", currentSessionStart=").append();
		sb.append(", sessionCount=").append();
		return sb.toString();
New to GrepCode? Check out our FAQ X