public void AppendData(string protocolToken, string val, string action, int maxSize, params GoogleAnalyticsHitType[] supportedHitTypes) { if (supportedHitTypes.Length > 0) { bool isActionSupprted = false; foreach (GoogleAnalyticsHitType h in supportedHitTypes) { if (h == currentHitType) { isActionSupprted = true; } } if (!isActionSupprted) { Debug.LogWarning("Google Analytics: " + action + " not supported for hit type " + currentHitType.ToString()); return; } } string data = EscapeString(val); builder.Append("&"); builder.Append(protocolToken); builder.Append("="); builder.Append(data); if (maxSize > 0) { CheckDataLength(action, data, maxSize); } }
//-------------------------------------- // HIT PROTOCOL //-------------------------------------- public void SetHitType(GoogleAnalyticsHitType hit) { AppendData("t", hit.ToString().ToLower()); }