Sunday, September 27, 2015

Google Analytics :: Tracking Code Overview

Tracking Code Overview

Google Analytics works by the inclusion of a block of JavaScript code on pages in your website. When users to your website view a page, this JavaScript code references a JavaScript file which then executes the tracking operation for Analytics. The tracking operation retrieves data about the page request through various means and sends this information to the Analytics server via a list of parameters attached to a single-pixel image request.
Because your website configuration and reporting needs might differ from a standard setup, it's a good idea to understand the general tracking process to ensure that your reports deliver data as you expect. In this way, you can decide how to configure Analytics tracking to best suit your own website.
The rest of this document covers:

How Does Google Analytics Collect Data?

The data that Google Analytics uses to provide all the information in your reports comes from these sources:
  • The HTTP request of the user
  • Browser/system information
  • First-party cookies
The HTTP request for any web page contains details about the browser and the computer making the request, such as the hostname, the browser type, referrer, and language. In addition, the DOM of most browsers provides access to more detailed browser and system information, such as Java and Flash support and screen resolution. Analytics uses this information in constructing reports like the Map Overlay, Browser, and Referring Sites reports. Analytics also sets and reads first-party cookies on your users' browsers in order to obtain user session and any ad campaign information from the page request. The Google Analytics Tracking Code also reads the double-click cookie to get information about the Display Features.
When all this information is collected, it is sent to the Analytics servers in the form of a long list of parameters attached to a single-pixel GIF image request. The data contained in the GIF request is the data sent to the Google Analytics servers, which then gets processed and ends up in your reports. Here is an example of only a portion of a GIF request:
www.google-analytics.com/.....  
For customers that have enabled the Remarketing with Google Analytics feature, a third-party DoubleClick cookie is used to enable remarketing for products like AdWords on the Google Display Network. When this feature is used, information (including the third-party DoubleClick cookie) is similarly sent to the Analytics servers, but the example request looks like:
www.stats.g.doubleclick.net/.....
For more information on the data contained in a GIF request, see the section "GIF Request Parameters" in the Troubleshooting Guide.

How the Tracking Code Works

In general, the Google Analytics Tracking Code (GATC) retrieves web page data as follows:
  1. A browser requests a web page that contains the tracking code.
  2. A JavaScript Array named _gaq is created and tracking commands are pushed onto the array.
  3. A <script> element is created and enabled for asynchronous loading (loading in the background).
  4. The ga.js tracking code is fetched, with the appropriate protocol automatically detected. Once the code is fetched and loaded, the commands on the _gaq array are executed and the array is transformed into a tracking object. Subsequent tracking calls are made directly to Google Analytics.
  5. Loads the script element to the DOM.
  6. After the tracking code collects data, the GIF request is sent to the Analytics database for logging and post-processing.
GATC Request Process

How GIF Requests Are Classified

A GIF request is sent to the Analytics servers in the following cases and classified according to the table below. In each of these cases, the GIF request is identified by type in the utmt parameter. In addition, the type of the request also determines which data is sent to the Analytics servers. For example, transaction and item data is only sent to the Analytics servers when a purchase is made. User, page, and system information is only sent when an event is recorded or when a page loads, and the user-defined value is only sent when the _setVar method is called.
Request Type Description Class
Page A web page on your server is requested. Interaction
Event An event is triggered through Event Tracking that you set up on your site. Interaction
Transaction A purchase transaction occurred on your site. Interaction
Item Each item in a transaction is recorded with a GIF request. Interaction
Var A custom user segment is set and triggered by a user. Non-interaction
Requests classified as interaction requests will impact the bounce rate calculations for your page or site. Bounce rate is referred to as a single-page session to your site, but is strictly defined as a single interaction request during a user session. For this reason, a bounce rate for a page is also affected by ecommerce transactions and event tracking requests. This is because these features co-exist with page tracking and, when they are triggered, they result in additional interaction requests to the Analytics servers.

The GIF Request Parameters

The GIF request is quite long. Here is an example of only a part of a GIF request:
www.google-analytics.com/2/.....   
This table contains a listing of the many of the parameters passed in via the GIF Request. Not all parameters are passed in with every execution of the tracking code, since some apply only to certain conditions, such as campaign referrals or shopping carts. When using this reference, keep in mind that you will be looking for those variables that most commonly apply to the page/request you are investigating.
Variable Description Example Value
utmac Account String. Appears on all requests. utmac=UA-2202604-2
utmcc Cookie values. This request parameter sends all the cookies requested from the page. utmcc=__utma%3D117243.1695285.22%3B%2B __utmz%3D117945243.1202416366.21.10. utmcsr%3Db%7C utmccn%3D(referral)%7C utmcmd%3Dreferral%7C utmcct%3D%252Fissue%3B%2B
utmcn Starts a new campaign session. Either utmcn or utmcr is present on any given request. Changes the campaign tracking data; but does not start a new session utmcn=1
utmcr Indicates a repeat campaign visit. This is set when any subsequent clicks occur on the same link. Either utmcn or utmcr is present on any given request. utmcr=1
utmcs Language encoding for the browser. Some browsers don't set this, in which case it is set to "-" utmcs=ISO-8859-1
utmdt Page title, which is a URL-encoded string. utmdt=analytics%20page%20test
utme Extensible Parameter Value is encoded. Used for events and custom variables.
utmfl Flash Version utmfl=9.0%20r48&
utmhn

Host Name, which is a URL-encoded string. utmhn=x343.gmodules.com
utmhid

A random number used to link Analytics GIF requests with AdSense. utmhid=2059107202
utmipc Product Code. This is the sku code for a given product.

utmipc=989898ajssi
utmipn Product Name, which is a URL-encoded string. utmipn=tee%20shirt
utmipr Unit Price. Set at the item level. Value is set to numbers only in U.S. currency format. utmipr=17100.32
utmiqt Quantity. utmiqt=4
utmiva Variations on an item. For example: large, medium, small, pink, white, black, green. String is URL-encoded. utmiva=red;
utmje Indicates if browser is Java-enabled. 1 is true. utmje=1
utmn Unique ID generated for each GIF request to prevent caching of the GIF image. utmn=1142651215
utmp Page request of the current page. utmp=/testDirectory/myPage.html
utmr Referral, complete URL. utmr=http://www.example.com/aboutUs/index.php?var=selected
utmsc Screen color depth utmsc=24-bit
utmsr Screen resolution utmsr=2400x1920&
utmt Indicates the type of request, which is one of: event, transaction, item, or custom variable. If this value is not present in the GIF request, the request is typed as page. utmt=event
utmtci Billing City utmtci=San%20Diego
utmtco Billing Country utmtco=United%20Kingdom
utmtid Order ID, URL-encoded string. utmtid=a2343898
utmtrg Billing region, URL-encoded string. utmtrg=New%20Brunswick
utmtsp Shipping cost. Values as for unit and price. utmtsp=23.95
utmtst Affiliation. Typically used for brick and mortar applications in ecommerce. utmtst=google%20mtv%20store
utmtto Total. Values as for unit and price. utmtto=334.56
utmttx Tax. Values as for unit and price. utmttx=29.16
utmul Browser language. utmul=pt-br
utmwv Tracking code version utmwv=1
========================================================================
Ref: https://developers.google.com/analytics/resources/concepts/gaConceptsTrackingOverview
========================================================================

PhoneGap : Icons and Splash Screens in Android and iOS

Icons and Splash Screens

This section shows how to configure an app's icon and optional splash screen for various platforms, both when working in the Cordova CLI (described in The Command-Line Interface) or using platform-specific SDK tools (detailed in the Platform Guides).

Configuring Icons in the CLI

When working in the CLI you can define app icon(s) via <icon> element (config.xml). If you do not specify an icon then the Apache Cordova logo is used.
    <icon src="res/ios/icon.png" platform="ios" width="57" height="57" density="mdpi" />
src: (required) specifies the location of the image file, relative to your project directory
platform: (optional) target platform
width: (optional) icon width in pixels
height: (optional) icon height in pixels
density: (optional) android specific, specifies icon density
The following configuration can be used to define single default icon which will be used for all platforms.
    <icon src="res/icon.png" />
For each platform you can also define a pixel-perfect icons set to fit different screen resolutions.

Android

     <platform name="android">
             
<icon src="res/android/ldpi.png" density="ldpi" />
             
<icon src="res/android/mdpi.png" density="mdpi" />
             
<icon src="res/android/hdpi.png" density="hdpi" />
             
<icon src="res/android/xhdpi.png" density="xhdpi" />
     
</platform>


iOS      

     <platform name="ios">
             
<!-- iOS 8.0+ -->
             
<!-- iPhone 6 Plus  -->
             
<icon src="res/ios/icon-60@3x.png" width="180" height="180" />
             
<!-- iOS 7.0+ -->
             
<!-- iPhone / iPod Touch  -->
             
<icon src="res/ios/icon-60.png" width="60" height="60" />
             
<icon src="res/ios/icon-60@2x.png" width="120" height="120" />
             
<!-- iPad -->
             
<icon src="res/ios/icon-76.png" width="76" height="76" />
             
<icon src="res/ios/icon-76@2x.png" width="152" height="152" />
             
<!-- iOS 6.1 -->
             
<!-- Spotlight Icon -->
             
<icon src="res/ios/icon-40.png" width="40" height="40" />
             
<icon src="res/ios/icon-40@2x.png" width="80" height="80" />
             
<!-- iPhone / iPod Touch -->
             
<icon src="res/ios/icon.png" width="57" height="57" />
             
<icon src="res/ios/icon@2x.png" width="114" height="114" />
             
<!-- iPad -->
             
<icon src="res/ios/icon-72.png" width="72" height="72" />
             
<icon src="res/ios/icon-72@2x.png" width="144" height="144" />
             
<!-- iPhone Spotlight and Settings Icon -->
             
<icon src="res/ios/icon-small.png" width="29" height="29" />
             
<icon src="res/ios/icon-small@2x.png" width="58" height="58" />
             
<!-- iPad Spotlight and Settings Icon -->
             
<icon src="res/ios/icon-50.png" width="50" height="50" />
             
<icon src="res/ios/icon-50@2x.png" width="100" height="100" />
     
</platform>

 
Configuring Splash Screens in the CLIIn the top-level config.xml file (not the one in platforms), add configuration elements like those specified here.

Example configuration

Please notice that the value of the "src" attribute is relative to the project directory and not to the www directory. You can name the source image whatever you like. The internal name in the app are determined by Cordova.
<platform name="android">
    <!-- you can use any density that exists in the Android project -->
    <splash src="res/screen/android/splash-land-hdpi.png" density="land-hdpi"/>
    <splash src="res/screen/android/splash-land-ldpi.png" density="land-ldpi"/>
    <splash src="res/screen/android/splash-land-mdpi.png" density="land-mdpi"/>
    <splash src="res/screen/android/splash-land-xhdpi.png" density="land-xhdpi"/>

    <splash src="res/screen/android/splash-port-hdpi.png" density="port-hdpi"/>
    <splash src="res/screen/android/splash-port-ldpi.png" density="port-ldpi"/>
    <splash src="res/screen/android/splash-port-mdpi.png" density="port-mdpi"/>
    <splash src="res/screen/android/splash-port-xhdpi.png" density="port-xhdpi"/>
</platform>
<platform name="ios">
    <!-- images are determined by width and height. The following are supported -->
    <splash src="res/screen/ios/Default~iphone.png" width="320" height="480"/>
    <splash src="res/screen/ios/Default@2x~iphone.png" width="640" height="960"/>
    <splash src="res/screen/ios/Default-Portrait~ipad.png" width="768" height="1024"/>
    <splash src="res/screen/ios/Default-Portrait@2x~ipad.png" width="1536" height="2048"/>
    <splash src="res/screen/ios/Default-Landscape~ipad.png" width="1024" height="768"/>
    <splash src="res/screen/ios/Default-Landscape@2x~ipad.png" width="2048" height="1536"/>
    <splash src="res/screen/ios/Default-568h@2x~iphone.png" width="640" height="1136"/>
    <splash src="res/screen/ios/Default-667h.png" width="750" height="1334"/>
    <splash src="res/screen/ios/Default-736h.png" width="1242" height="2208"/>
    <splash src="res/screen/ios/Default-Landscape-736h.png" width="2208" height="1242"/>
</platform>
<platform name="wp8">
    <!-- images are determined by width and height. The following are supported -->
    <splash src="res/screen/wp8/SplashScreenImage.jpg" width="768" height="1280"/>
</platform>
<platform name="windows8">
    <!-- images are determined by width and height. The following are supported -->
    <splash src="res/screen/windows8/splashscreen.png" width="620" height="300"/>
</platform>
<platform name="blackberry10">
    <!-- Add a rim:splash element for each resolution and locale you wish -->
    <!-- http://developer.blackberry.com/html5/documentation/rim_splash_element.html -->
    <rim:splash src="res/screen/windows8/splashscreen.png"/>
</platform>

<preference name="SplashScreenDelay" value="10000" />

Saturday, September 26, 2015

Web Hosting Providers Offering MariaDB


MariaDB is a rightful successor replacement for MySQL. 
MariaDB supports a lot of commands and interfaces that are closer to NoSQL than to SQL.

How to Record a Video from the Screen of an iPhone/iPad/iPod Touch

Recording a Video from the Screen of an iPhone
Recording a Video from the Screen of an iPad
Recording a Video from the Screen of an iPod Touch. 

Easy Steps:

1) Connect the device to your Mac as normal.

2) Open iTunes.

3) If you see the "Trust This Computer" message, confirm to trust it.

4) Open QuickTime.

5) Open the File menu on the top of your screen and select "New Movie Recording".

Thursday, September 24, 2015

iOS Push Notification Works in Apps Installed via Xcode but Not Installed via iTunes

iOS Push Notification Works in Apps Installed via Xcode but Not Installed via iTunes



Two easy steps to check and resolve this issue:

1) If your iOS mobile device is capable of using the cellular data network, check that it has an active cellular data plan. Turn off Wi-Fi in Settings and see if you can still browse the web with Safari, for example. On the other hand, if the push service is using Wi-Fi, any firewalls between your device or computer and the Internet must allow TCP traffic to and from port 5223. To check open ports, you can use: netstat -an

2) Make sure you are using "gateway.push.apple.com" and not "gateway.sandbox.push.apple.com".




Wednesday, September 23, 2015

How to find the UDID of your iPhone, iPad or iPod Touch

How to find the UDID of your iPhone, iPad or iPod Touch


How to find the UDID of your iPhone, iPad or iPod Touch
How to find the UDID of your iPhone, iPad or iPod Touch

Each iPhone, iPad or iPod Touch has a Unique Device Identifier (UDID), which is a sequence of 40 letters and numbers that is specific to the device. It’s like a serial number but much harder to guess. It will look something like this: 529175579735ef98088z9de5bdfbbd550ceba661

Tuesday, September 22, 2015

KISSS principle (not KISS)

KISSS principle (not KISS)


KISSS is an acronym for "keep it short, simple and straightforward".

 

A Tiny Cheat Sheet for Composition, Aggregation and Association

A Tiny Cheat Sheet for Composition, Aggregation and Association

 

Composition Dependent lifecycles AND Ownership

Example: Car AND Engine

 

Aggregation Independent lifecycles AND Ownership

Example: Department AND Full-Time Professors

 

Association Independent lifecycles AND No Ownership

Example: Professors AND Students

Sunday, September 20, 2015

ABSTRACT FACTORY

ABSTRACT FACTORY

 

 

Abstract Factory

:: In Review

An Abstract Factory provides an interface for creating families of related or dependent objects without specifying their concrete classes.

1.                   

2.          

3.   

4.  using System;

5.   

6.  namespace DoFactory.GangOfFour.Abstract.Structural

7.  {

8.    /// <summary>

9.    /// MainApp startup class for Structural

10.  /// Abstract Factory Design Pattern.

11.  /// </summary>

12.  class MainApp

13.  {

14.    /// <summary>

15.    /// Entry point into console application.

16.    /// </summary>

17.    public static void Main()

18.    {

19.      // Abstract factory #1

20.      AbstractFactory factory1 = new ConcreteFactory1();

21.      Client client1 = new Client(factory1);

22.      client1.Run();

23. 

24.      // Abstract factory #2

25.      AbstractFactory factory2 = new ConcreteFactory2();

26.      Client client2 = new Client(factory2);

27.      client2.Run();

28. 

29.      // Wait for user input

30.      Console.ReadKey();

31.    }

32.  }

33. 

34.  /// <summary>

35.  /// The 'AbstractFactory' abstract class

36.  /// </summary>

37.  abstract class AbstractFactory

38.  {

39.    public abstract AbstractProductA CreateProductA();

40.    public abstract AbstractProductB CreateProductB();

41.  }

42. 

43. 

44.  /// <summary>

45.  /// The 'ConcreteFactory1' class

46.  /// </summary>

47.  class ConcreteFactory1 : AbstractFactory

48.  {

49.    public override AbstractProductA CreateProductA()

50.    {

51.      return new ProductA1();

52.    }

53.    public override AbstractProductB CreateProductB()

54.    {

55.      return new ProductB1();

56.    }

57.  }

58. 

59.  /// <summary>

60.  /// The 'ConcreteFactory2' class

61.  /// </summary>

62.  class ConcreteFactory2 : AbstractFactory

63.  {

64.    public override AbstractProductA CreateProductA()

65.    {

66.      return new ProductA2();

67.    }

68.    public override AbstractProductB CreateProductB()

69.    {

70.      return new ProductB2();

71.    }

72.  }

73. 

74.  /// <summary>

75.  /// The 'AbstractProductA' abstract class

76.  /// </summary>

77.  abstract class AbstractProductA

78.  {

79.  }

80. 

81.  /// <summary>

82.  /// The 'AbstractProductB' abstract class

83.  /// </summary>

84.  abstract class AbstractProductB

85.  {

86.    public abstract void Interact(AbstractProductA a);

87.  }

88. 

89. 

90.  /// <summary>

91.  /// The 'ProductA1' class

92.  /// </summary>

93.  class ProductA1 : AbstractProductA

94.  {

95.  }

96. 

97.  /// <summary>

98.  /// The 'ProductB1' class

99.  /// </summary>

100.   class ProductB1 : AbstractProductB

101.   {

102.     public override void Interact(AbstractProductA a)

103.     {

104.       Console.WriteLine(this.GetType().Name +

105.         " interacts with " + a.GetType().Name);

106.     }

107.   }

108.  

109.   /// <summary>

110.   /// The 'ProductA2' class

111.   /// </summary>

112.   class ProductA2 : AbstractProductA

113.   {

114.   }

115.  

116.   /// <summary>

117.   /// The 'ProductB2' class

118.   /// </summary>

119.   class ProductB2 : AbstractProductB

120.   {

121.     public override void Interact(AbstractProductA a)

122.     {

123.       Console.WriteLine(this.GetType().Name +

124.         " interacts with " + a.GetType().Name);

125.     }

126.   }

127.  

128.   /// <summary>

129.   /// The 'Client' class. Interaction environment for the products.

130.   /// </summary>

131.   class Client

132.   {

133.     private AbstractProductA _abstractProductA;

134.     private AbstractProductB _abstractProductB;

135.  

136.     // Constructor

137.     public Client(AbstractFactory factory)

138.     {

139.       _abstractProductB = factory.CreateProductB();

140.       _abstractProductA = factory.CreateProductA();

141.     }

142.  

143.     public void Run()

144.     {

145.       _abstractProductB.Interact(_abstractProductA);

146.     }

147.   }

148. }

149.  

150.  

151.           

152.             

=

=

=

=

=