Usage

Install Extension Bundle

This extension uses Slf4j for logging and will require the slf4j-api and a slf4j provider such as install4j-slf4j.

Some additional libraries are also required. To help configure install4j you can unzip the install4j-ga-VERSION-bundle.zip into the extensions directory:

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
                <execution>
                    <id>install-extension</id>
                    <phase>pre-integration-test</phase>
                    <goals>
                        <goal>unpack</goal>
                    </goals>
                    <configuration>
                        <outputDirectory>${install4j.home}/extensions</outputDirectory>
                        <artifactItems>
                            <artifactItem>
                                <groupId>org.sonatype.install4j</groupId>
                                <artifactId>install4j-ga</artifactId>
                                <classifier>bundle</classifier>
                                <type>zip</type>
                                <version>VERSION</version>
                            </artifactItem>
                        </artifactItems>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

Besure to configure the proper VERSION and configure the install4j.home property.

The bundle is a simple zip file containing the extension component and its dependencies, such as:

install4j-slf4j.jar
slf4j-api.jar
JGoogleAnalyticsTracker.jar
install4j-ga.jar

Actions

image

Configure Proxy

Configure HTTP proxy settings. This will bridge the HTTP proxy configuration as detected by install4j.

This action should be placed before any other GA actions.

Track Event

Track a single event.

At the moment only supports the following configuration:

  • Tracking Code (string)
  • Category (string)
  • Action (string)
  • Label (string)
  • Value (integer)

Track Event on Cancel

Track an event when user cancels installation.

Supports the same configuration as Track Event but will automatically set the Value to the progress percent completed when canceled.

This action should be placed early in the installer configuration, like in Startup.

Disabling Functionality

You can disable all functionality of these events by setting the system property:

-Dorg.sonatype.install4j.ga.GoogleAnalyticsActionSupport.disable=true

This is handy for testing so you don’t send tracking events without having to disable the actions in install4j.