Issue With JavaScript tracker and Scala Stream collector

135 views
Skip to first unread message

Jeetu Choudhary

unread,
Mar 31, 2016, 5:25:42 PM3/31/16
to Snowplow
I have created a Scala Stream Collector and i want to track data using javascript tracker and send it to Scala Stream collector. But i don't know how to do interaction between ScalaStream Collector and Java script tracker.
Scala Stream collector is running on my local host

Thanks

Ihor Tomilenko

unread,
Mar 31, 2016, 6:05:57 PM3/31/16
to Snowplow
Hi Jeetu,

I assume all your tests are done locally, that is the web page you have embedded the tracker into is also open on the same machine.

When you initializing the JavaScript tracker you have to specify its address including the port number if different from 80.

window.snowplow('newTracker', 'stream-collector', '{{MY-COLLECTOR-URI}}', { // Initialise a tracker
  appId: '{{MY-SITE-ID}}',
});
In your case replace {{MY-COLLECTOR-URI}}  with localhost. Obviously, it's not going to work if accessed remotely, in which case the tracker should have a publicly accessible IP/domain.

Read more on integrating the JS tracker here.

Regards,
Ihor

Jeetu Choudhary

unread,
Apr 1, 2016, 1:52:37 AM4/1/16
to Snowplow
Thanks Ihor for help
Yes i have tested it locally and it works fine, now i need to access it remotely, i want to access it through ec2 instance, so can you please tell me how to do it.
Thanks

Ihor Tomilenko

unread,
Apr 1, 2016, 2:15:54 PM4/1/16
to Snowplow
Hi Jeetu,

This is not something specific to Snowplow. You can find the relevant info on Amazon docs site. This page could be a starting point.

In short, an EC2 comes with a Public DNS and Public IP. If you are still in testing then that DNS should be sufficient (replace localhost with that Public DNS). It also important to ensure you set up the Security Group correctly as you have to have the relevant port open.

Another important point: make sure you save your SSH key pair when setting up an EC2 as you won't be able to retrieve it later on and thus won't be able to SSH into your box. You might wish to take a look at this wiki page for an example of setting up EC2. Its about setting up PostgreSQL but the initial part is telling about EC2 and has up-to-date screenshots.

When you are ready to launch a production instance you might find the following wiki page on IAM setup useful.

Regards,
Ihor
Reply all
Reply to author
Forward
0 new messages