Skip to content

Set your tracker to point at the Clojure collector endpoint

Yali Sassoon edited this page May 7, 2013 · 4 revisions

HOME > SNOWPLOW SETUP GUIDE > Step 1: setup a Collector > Clojure collector setup > Set your tracker to point at the Clojure collector endpoint

Now that you've set up your Clojure collector, you need to configure your tracker to send event data to it.

Assuming you're using the Javascript tracker, you'll need to modify your Javascript tracking tags to set the correct end point. The standard tracking tags look as follows:

<!-- Snowplow starts plowing -->
<script type="text/javascript">
var _snaq = _snaq || [];

_snaq.push(['setCollectorCf', '{{CLOUDFRONT DOMAIN}}']);
_snaq.push(['enableLinkTracking']);
_snaq.push(['trackPageView']);

(function() {
var sp = document.createElement('script'); sp.type = 'text/javascript'; sp.async = true; sp.defer = true;
sp.src = ('https:' == document.location.protocol ? 'https' : 'http') + '://d1fc8wv8zag5ca.cloudfront.net/0.9.1/sp.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(sp, s);
})();
 </script>
<!-- Snowplow stops plowing -->

The line...

_snaq.push(['setCollectorCf', '{{CLOUDFRONT DOMAIN}}']);

...is the one that sets the end point, and assumes that you're using the Cloudfront collector rather than the Clojure collector.

To set your Clojure collector as the end point, remove that line and replace it with:

_snaq.push(['setCollectorUrl', '{{COLLECTOR URL}}']);

Note that the URL your enter must exclude http:// or https://. In our case, the url would be: collector.snplow.com.

Also, you need to tell the JavaScript that it doesn't need to send user IDs to the collector - this is because your Clojure collector is now setting user IDs. You do this like so:

_snaq.push(['attachUserId', false]);

So, the complete tag will look like this:

<!-- Snowplow starts plowing -->
<script type="text/javascript">
var _snaq = _snaq || [];

_snaq.push(['setCollectorUrl', 'collector.snplow.com']);
_snaq.push(['attachUserId', false]);
_snaq.push(['enableLinkTracking']);
_snaq.push(['trackPageView']);

(function() {
var sp = document.createElement('script'); sp.type = 'text/javascript'; sp.async = true; sp.defer = true;
sp.src = ('https:' == document.location.protocol ? 'https' : 'http') + '://d1fc8wv8zag5ca.cloudfront.net/0.9.1/sp.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(sp, s);
})();
 </script>
<!-- Snowplow stops plowing -->

Next: update the EmrEtlRunner configuration YAML file

HOME > SNOWPLOW SETUP GUIDE > Collectors > Clojure collector setup

Setup Snowplow

  1. [Setup a Collector] (setting-up-a-collector)
  1. [Step 2: Setup a Tracker] (setting-up-a-tracker)
  2. [Step 3: Setup EmrEtlRunner] (setting-up-EmrEtlRunner)
  3. [Step 4: Setup the StorageLoader] (setting-up-storageloader)
  4. [Step 5: Analyze your data!] (Getting started analyzing Snowplow data)

Useful resources

Clone this wiki locally