Package com.eclipsesource.tabris.tracking.internal.analytics

Examples of com.eclipsesource.tabris.tracking.internal.analytics.GoogleAnalytics


    new GoogleAnalyticsTracker( "foo", "" );
  }

  @Test
  public void testSendsPageView() {
    GoogleAnalytics analytics = mock( GoogleAnalytics.class );
    GoogleAnalyticsTracker tracker = new GoogleAnalyticsTracker( analytics );
    TrackingEvent event = new TrackingEvent( EventType.PAGE_VIEW, createInfo(), "foo", 1 );

    tracker.handleEvent( event );
View Full Code Here


    assertEquals( "foo", hitCaptor.getValue().getParameter().get( getRequestKey( RequestKeys.SCREEN_NAME ) ) );
  }

  @Test
  public void testSendsAction() {
    GoogleAnalytics analytics = mock( GoogleAnalytics.class );
    GoogleAnalyticsTracker tracker = new GoogleAnalyticsTracker( analytics );
    TrackingEvent event = new TrackingEvent( EventType.ACTION, createInfo(), "foo", 1 );

    tracker.handleEvent( event );
View Full Code Here

    assertEquals( LABEL_EXECUTE, hitCaptor.getValue().getParameter().get( getRequestKey( RequestKeys.EVENT_ACTION ) ) );
  }

  @Test
  public void testSendsSearchAction() {
    GoogleAnalytics analytics = mock( GoogleAnalytics.class );
    GoogleAnalyticsTracker tracker = new GoogleAnalyticsTracker( analytics );
    TrackingEvent event = new TrackingEvent( EventType.SEARCH, createInfo(), "foo", 1 );

    tracker.handleEvent( event );
View Full Code Here

    assertEquals( "query", configCaptor.getValue().getParameter().get( getRequestKey( RequestKeys.CUSTOM_DIMENSION, 1 ) ) );
  }

  @Test
  public void testSendsSearchActionWithConfiguredCustomDimension() {
    GoogleAnalytics analytics = mock( GoogleAnalytics.class );
    GoogleAnalyticsTracker tracker = new GoogleAnalyticsTracker( analytics );
    TrackingEvent event = new TrackingEvent( EventType.SEARCH, createInfo(), "foo", 1 );

    tracker.setSearchCustomDimension( 2 );
    tracker.handleEvent( event );
View Full Code Here

    assertEquals( "query", configCaptor.getValue().getParameter().get( getRequestKey( RequestKeys.CUSTOM_DIMENSION, 2 ) ) );
  }

  @Test( expected = IllegalArgumentException.class )
  public void testFailsToSetZeroSearchIndex() {
    GoogleAnalytics analytics = mock( GoogleAnalytics.class );
    GoogleAnalyticsTracker tracker = new GoogleAnalyticsTracker( analytics );

    tracker.setSearchCustomDimension( 0 );
  }
View Full Code Here

    tracker.setSearchCustomDimension( 0 );
  }

  @Test( expected = IllegalArgumentException.class )
  public void testFailsToSetNegativeSearchIndex() {
    GoogleAnalytics analytics = mock( GoogleAnalytics.class );
    GoogleAnalyticsTracker tracker = new GoogleAnalyticsTracker( analytics );

    tracker.setSearchCustomDimension( -1 );
  }
View Full Code Here

    tracker.setSearchCustomDimension( -1 );
  }

  @Test
  public void testSendsEvent() {
    GoogleAnalytics analytics = mock( GoogleAnalytics.class );
    GoogleAnalyticsTracker tracker = new GoogleAnalyticsTracker( analytics );
    TrackingEvent event = new TrackingEvent( EventType.EVENT, createInfo(), "foo", 1 );

    tracker.handleEvent( event );
View Full Code Here

    assertEquals( LABEL_EVENT, hitCaptor.getValue().getParameter().get( getRequestKey( RequestKeys.EVENT_ACTION ) ) );
  }

  @Test
  public void testSendsOrder() {
    GoogleAnalytics analytics = mock( GoogleAnalytics.class );
    GoogleAnalyticsTracker tracker = new GoogleAnalyticsTracker( analytics );
    Order order = new Order( "foo", BigDecimal.ONE );
    TrackingEvent event = new TrackingEvent( EventType.ORDER, createInfo(), order, 1 );

    tracker.handleEvent( event );
View Full Code Here

    assertEquals( Double.valueOf( 0 ), hitCaptor.getValue().getParameter().get( getRequestKey( RequestKeys.TRANSACTION_TAX ) ) );
  }

  @Test
  public void testSendsOrderWithItems() {
    GoogleAnalytics analytics = mock( GoogleAnalytics.class );
    GoogleAnalyticsTracker tracker = new GoogleAnalyticsTracker( analytics );
    Order order = new Order( "foo", BigDecimal.ONE );
    order.addItem( new OrderItem( "bar" ).setCategory( "blub" ).setSKU( "hmpf" ) );
    TrackingEvent event = new TrackingEvent( EventType.ORDER, createInfo(), order, 1 );
View Full Code Here

    assertEquals( "en-CA", configuration.getParameter().get( getRequestKey( RequestKeys.USER_LANGUAGE ) ) );
  }

  @Test
  public void testAndroidUserAgent() {
    GoogleAnalytics analytics = mock( GoogleAnalytics.class );
    GoogleAnalyticsTracker tracker = new GoogleAnalyticsTracker( analytics );
    TrackingInfo info = createInfo();
    info.setPlatform( Platform.ANDROID );
    info.setDeviceOsVersion( "4.4" );
    TrackingEvent event = new TrackingEvent( EventType.SEARCH, info, "foo", 1 );
View Full Code Here

TOP

Related Classes of com.eclipsesource.tabris.tracking.internal.analytics.GoogleAnalytics

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.