Esempio n. 1
0
        public void SampleCodeForGitHubReadMeManuallyConstructingEventObject()
        {
            //create a new EventTracker
            IEventTracker eventTracker = new EventTracker();
            //create a new event to pass to the event tracker
            IUniversalAnalyticsEvent analyticsEvent = new UniversalAnalyticsEvent(
                //Required. The universal analytics tracking id for the property
                // that events will be logged to. If you don't want to pass this every time, set the UniversalAnalytics.TrackingId
                // app setting and use the UniversalAnalyticsEventFactory to get instances of this class.
                // See https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#tid for details.
                "UA-52982625-3",
                //Required. Anonymous client id.
                //See https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#cid for details.
                "developer",
                //Required. The event category for the event.
                // See https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#ec for details.
                "test category",
                //Required. The event action for the event.
                //See https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#ea for details.
                "test action",
                //Optional. The event label for the event.
                // See https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#el for details.
                "test label",
                //Optional. The event value for the event.
                // See https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#ev for details.
                "10");

            eventTracker.TrackEvent(analyticsEvent);
        }
 public void SampleCodeForGitHubReadMeManuallyConstructingEventObject()
 {
     //create a new EventTracker
     IEventTracker eventTracker = new EventTracker();
     //create a new event to pass to the event tracker
     IUniversalAnalyticsEvent analyticsEvent = new UniversalAnalyticsEvent(
         //Required. The universal analytics tracking id for the property
         // that events will be logged to. If you don't want to pass this every time, set the UniversalAnalytics.TrackingId
         // app setting and use the UniversalAnalyticsEventFactory to get instances of this class.
         // See https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#tid for details.
         "UA-52982625-3",
         //Required. Anonymous client id.
         //See https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#cid for details.
         "developer",
         //Required. The event category for the event.
         // See https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#ec for details.
         "test category",
         //Required. The event action for the event.
         //See https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#ea for details.
         "test action",
         //Optional. The event label for the event.
         // See https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#el for details.
         "test label",
         //Optional. The event value for the event.
         // See https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#ev for details.
         "10");
     eventTracker.TrackEvent(analyticsEvent);
 }
Esempio n. 3
0
        public void ItSetsEventLabelInTheConstructor()
        {
            UniversalAnalyticsEvent universalAnalyticsEvent = new UniversalAnalyticsEvent(
                trackingId,
                anonymousClientId,
                eventCategory,
                eventAction,
                eventLabel);

            Assert.AreEqual(eventLabel, universalAnalyticsEvent.EventLabel);
        }
Esempio n. 4
0
        public void ItSetsEventLabelInTheConstructor()
        {
            UniversalAnalyticsEvent universalAnalyticsEvent = new UniversalAnalyticsEvent(
                _trackingId,
                this._clientId,
                _eventCategory,
                _eventAction,
                _eventLabel);

            Assert.AreEqual(_eventLabel, universalAnalyticsEvent.EventLabel);
        }
        public void ItSetsEventLabelInTheConstructor()
        {
            UniversalAnalyticsEvent universalAnalyticsEvent = new UniversalAnalyticsEvent(
                trackingId,
                anonymousClientId,
                eventCategory,
                eventAction,
                eventLabel);

            Assert.AreEqual(eventLabel, universalAnalyticsEvent.EventLabel);
        }
Esempio n. 6
0
        private UniversalAnalyticsEvent GetFullyPopulatedEventUsingConstructor()
        {
            UniversalAnalyticsEvent universalAnalyticsEvent = new UniversalAnalyticsEvent(
                trackingId,
                anonymousClientId,
                eventCategory,
                eventAction,
                eventLabel,
                eventValue);

            return(universalAnalyticsEvent);
        }
Esempio n. 7
0
        private UniversalAnalyticsEvent GetFullyPopulatedEventUsingConstructor()
        {
            UniversalAnalyticsEvent universalAnalyticsEvent = new UniversalAnalyticsEvent(
                _trackingId,
                this._clientId,
                _eventCategory,
                _eventAction,
                _eventLabel,
                _eventValue);

            return(universalAnalyticsEvent);
        }
        public void ItSetsEventValueInTheConstructor()
        {
            UniversalAnalyticsEvent universalAnalyticsEvent = new UniversalAnalyticsEvent(
                trackingId,
                this.clientId,
                eventCategory,
                eventAction,
                eventLabel,
                eventValue);

            Assert.AreEqual(eventValue, universalAnalyticsEvent.EventValue);
        }
Esempio n. 9
0
        public void ItSetsTheUserIdInTheConstructor()
        {
            UniversalAnalyticsEvent universalAnalyticsEvent = new UniversalAnalyticsEvent(
                _trackingId,
                _clientId,
                _eventCategory,
                _eventAction,
                _eventLabel,
                _eventValue,
                _userId);

            Assert.AreEqual(this._userId, universalAnalyticsEvent.UserId);
        }
Esempio n. 10
0
        public void ItSetsTheAnonymousClientIdInTheConstructor()
        {
            UniversalAnalyticsEvent universalAnalyticsEvent = GetFullyPopulatedEventUsingConstructor();

            Assert.AreEqual(anonymousClientId, universalAnalyticsEvent.AnonymousClientId);
        }
Esempio n. 11
0
        public void ItSetsTheTrackingIdInTheConstructor()
        {
            UniversalAnalyticsEvent universalAnalyticsEvent = GetFullyPopulatedEventUsingConstructor();

            Assert.AreEqual(trackingId, universalAnalyticsEvent.TrackingId);
        }
 private UniversalAnalyticsEvent GetFullyPopulatedEventUsingConstructor()
 {
     UniversalAnalyticsEvent universalAnalyticsEvent = new UniversalAnalyticsEvent(
         trackingId,
         anonymousClientId,
         eventCategory,
         eventAction,
         eventLabel,
         eventValue);
     return universalAnalyticsEvent;
 }