Overview

Heap is a modern take on analytics. There's no need to ship event tracking code, no need to wait days or weeks for data to accumulate, no need to muddle your codebase, and no need to fumble with rigid reports.

For the first time, meaningful product questions can be answered just as soon as they're asked.

Installation

Web

To get started with Heap, paste the following code snippet before your website's closing </head> tag:

    <script type="text/javascript">
      window.heap=window.heap||[];heap.load=function(a){window._heapid=a;var b=document.createElement("script");b.type="text/javascript",b.async=!0,b.src=("https:"===document.location.protocol?"https:":"http:")+"//cdn.heapanalytics.com/js/heap.js";var c=document.getElementsByTagName("script")[0];c.parentNode.insertBefore(b,c);var d=function(a){return function(){heap.push([a].concat(Array.prototype.slice.call(arguments,0)))}},e=["identify","track"];for(var f=0;f<e.length;f++)heap[e[f]]=d(e[f])};
      heap.load("YOUR_APP_ID");
    </script>
  

iOS

We recommend using Cocoapods to quickly and easily add Heap:

  1. Install Cocoapods by running sudo gem install cocoapods.
  2. Create a file in your Xcode project directory called Podfile.
  3. Add the following line to your Podfile:
  4.   pod 'Heap'
  5. Run pod install within your Xcode project directory.
  6. Initialize Heap with your app ID. We recommend doing this in applicationDidFinishLaunching: or application:didFinishLaunchingWithOptions in your Application delegate as follows:
  #import "Heap.h"

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
        // Override point for customization after application launch.
        [[Heap sharedInstance] setAppId:@"YOUR_APP_ID"];

        /* Other launch code goes here */

        return YES;
    }

Or you can install Heap manually:

  1. Download the Heap iOS library.
  2. Unzip the downloaded file and drag libHeap.a and Heap.h into your XCode project.
  3. Click on the project (blue project icon), select "Build Settings".
  4. Within Build Settings, change "Other Linker Flags" to include -all_load -ObjC as a flag.
  5. Add "SystemConfiguration" and "UIKit" as linked frameworks. (For detailed instructions on how to add a framework: http://stackoverflow.com/questions/19337890/how-to-add-an-existing-framework-in-xcode-5).
  6. Initialize Heap with your app ID, as illustrated in the code snippet above.

After installing Heap on web or iOS, navigate to your dashboard. Under 'Suggested Events', you'll see a list of the most popular user interactions happening in your app. All you need to do is simply tag events of interest, and you can begin running analytics on them immediately. Suggested Events Screenshot

Custom Integrations

Wordpress

Installation on Wordpress is simple:

  1. Login to your Wordpress Admin console (generally at /wp-admin on your wordpress site).
  2. Navigate to the Theme Editor

  3. Locate the header.php file

  4. Paste the following code snippet before the line of code that says </head>

        <script type="text/javascript">
          window.heap=window.heap||[];heap.load=function(a){window._heapid=a;var b=document.createElement("script");b.type="text/javascript",b.async=!0,b.src=("https:"===document.location.protocol?"https:":"http:")+"//cdn.heapanalytics.com/js/heap.js";var c=document.getElementsByTagName("script")[0];c.parentNode.insertBefore(b,c);var d=function(a){return function(){heap.push([a].concat(Array.prototype.slice.call(arguments,0)))}},e=["identify","track"];for(var f=0;f<e.length;f++)heap[e[f]]=d(e[f])};
          heap.load("YOUR_APP_ID");
        </script>
      

  5. It should look something like this:

  6. That's it! You're ready to begin using Heap.