Mobile app version of vmapp.org
Login or Join
Jessie594

: Track url from Amazon S3 using Google Analytics I couldn't find any decent pay per view video solutions for low budget clients. So I'm considering using a membership extension with Joomla and

@Jessie594

Posted in: #AmazonS3 #GoogleAnalytics

I couldn't find any decent pay per view video solutions for low budget clients. So I'm considering using a membership extension with Joomla and hosting the video with amazon S3.

The only issue is that once someone has signed up to view or download the video if they have any web development experience they will be able to get the url of the video and freely publish it on the web.

How can this be prevented? It looks like it can be done using IAM User Temporary Credentials - AWS SDK for PHP but the client would prefer not to have to pay someone to spend hours writing custom php code to get this to work.

With Amazon s3 I could at least check the log files I guess to manually monitor the url but is there a way to track the url with Google Analytics? or is there a more elegant solution?

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Jessie594

3 Comments

Sorted by latest first Latest Oldest Best

 

@Phylliss660

Amazon S3 can be configured to use "referrer check", in which case only the specified domain(s) can access the file. This can be done from within the AWS web console by adding a Bucket Policy. Details here forums.aws.amazon.com/thread.jspa?messageID=340757 . It is also explained in docs somewhere. Navigate to Policy of a bucket and look for help/guide. In case of Flash embedding and referrer issues, you can add CORS rules (new feature and allows flash to be embed video from s3 etc by making cross domain policies). It sounds complicated but is not. All of it can be done from AWS Console.

You can enable logging of S3 requests, but with the above there is no such of someone hotlinking your content. Note that they could still download and save videos and there is no way around it as it is done on the client side. But they can't steal your bandwidth.

For really tough content control: There is no way around this without coding and extensive setup. The solution involves using Cloudfront for Streaming and you have to setup your Streaming server. Cloudfront just takes the load off of your streaming server.

10% popularity Vote Up Vote Down


 

@Berumen354

I Tweeted this question and thankfully Renegade Empire posted a link to a solution -
www.labnol.org/internet/prevent-image-hotlinking-in-amazon-s3/13156/
It's a clever and elegant bit of trickery :)

10% popularity Vote Up Vote Down


 

@Jennifer507

It seems there are two sides of your problem: first is access control (only registered users should be able to download your video), and second is access tracking (with Google Analytics).

I don't think there is a solution for both needs. I think you will have to get some programming for access control first. One possible solution would be to use a S3-feature called "expiring URLs" that only allow access for a limited time:
www.ioncannon.net/programming/21/creating-s3-urls-that-expire-using-php/
When you are using the official Amazon AWS PHP SDK, this will probably be the method you are looking for:
docs.amazonwebservices.com/AWSSDKforPHP/latest/index.html#m=AmazonS3/get_object_url
In Analytics, you can set up event tracking and add custom events on your download links, for example:

<a href="#" onclick="_gaq.push(['_trackEvent', 'MySite', 'Video', 'Download']);"


The documentation for this feature is available here: developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme