ahoy_matey 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +21 -7
- data/lib/ahoy/controller_extensions.rb +9 -0
- data/lib/ahoy/version.rb +1 -1
- data/lib/ahoy_matey.rb +3 -0
- data/lib/generators/ahoy/templates/install.rb +1 -4
- data/vendor/assets/javascripts/ahoy.js +2 -7
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0885adb69bce04e71f7fd609edc8c780355faf3d
|
4
|
+
data.tar.gz: 0f28e71f18107dfd51a323a451e1c688dc14434c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee3c5d227ab4ee129e986bc315acac53569664f99c99e5a131b286c6a1f6822ac148891e7c44e60e0edb5fc76e5d494e5a665f89fdba03a190c442db134aecac
|
7
|
+
data.tar.gz: 1ecec9955ebed58e57ea78e22fafaaae7a8fc8c24a4f3debc928a5da109fc8be4db9174c257c5c32b1dde228d13aa53745d4b4c3c57d99625a702be6a3c673cd
|
data/README.md
CHANGED
@@ -1,8 +1,16 @@
|
|
1
1
|
# Ahoy
|
2
2
|
|
3
|
-
Simple, powerful visit tracking for Rails.
|
3
|
+
:fire: Simple, powerful visit tracking for Rails.
|
4
4
|
|
5
|
-
|
5
|
+
In under a minute, start learning more about your visitors.
|
6
|
+
|
7
|
+
- traffic source - referrer, referring domain, campaign, landing page
|
8
|
+
- location - country, region, and city
|
9
|
+
- technology - browser, OS, and device type
|
10
|
+
|
11
|
+
It’s all stored in **your database** so you can easily combine it with other models.
|
12
|
+
|
13
|
+
## Ready, Set, Go!
|
6
14
|
|
7
15
|
Add this line to your application’s Gemfile:
|
8
16
|
|
@@ -17,20 +25,18 @@ rails generate ahoy:install
|
|
17
25
|
rake db:migrate
|
18
26
|
```
|
19
27
|
|
20
|
-
|
28
|
+
Lastly, include the javascript file in `app/assets/javascripts/application.js` after jQuery.
|
21
29
|
|
22
30
|
```javascript
|
23
31
|
//= require jquery
|
24
32
|
//= require ahoy
|
25
33
|
```
|
26
34
|
|
27
|
-
That’s it.
|
28
|
-
|
29
35
|
## What You Get
|
30
36
|
|
31
37
|
When a person visits your website, Ahoy creates a visit with lots of useful information.
|
32
38
|
|
33
|
-
- source (referrer, referring domain, campaign, landing page)
|
39
|
+
- traffic source (referrer, referring domain, campaign, landing page)
|
34
40
|
- location (country, region, and city)
|
35
41
|
- technology (browser, OS, and device type)
|
36
42
|
|
@@ -40,7 +46,7 @@ You can store the visit id on any model. For instance, when someone places an or
|
|
40
46
|
|
41
47
|
```ruby
|
42
48
|
Order.create!(
|
43
|
-
|
49
|
+
ahoy_visit_id: ahoy_visit.id,
|
44
50
|
# ... more attributes ...
|
45
51
|
)
|
46
52
|
```
|
@@ -67,6 +73,14 @@ It sends the event to the server.
|
|
67
73
|
|
68
74
|
A visit cookie is set for 4 hours, and a visitor cookie is set for 2 years.
|
69
75
|
|
76
|
+
## TODO
|
77
|
+
|
78
|
+
- better readme
|
79
|
+
- model integration
|
80
|
+
- update visit when user logs in
|
81
|
+
- better browser / OS detection
|
82
|
+
- set ahoy_visit_id automatically on `visitable` models
|
83
|
+
|
70
84
|
## Contributing
|
71
85
|
|
72
86
|
Everyone is encouraged to help improve this project. Here are a few ways you can help:
|
data/lib/ahoy/version.rb
CHANGED
data/lib/ahoy_matey.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require "ahoy/version"
|
2
|
+
require "ahoy/controller_extensions"
|
2
3
|
require "addressable/uri"
|
3
4
|
require "browser"
|
4
5
|
require "geocoder"
|
@@ -8,3 +9,5 @@ module Ahoy
|
|
8
9
|
isolate_namespace Ahoy
|
9
10
|
end
|
10
11
|
end
|
12
|
+
|
13
|
+
ActionController::Base.send :include, Ahoy::ControllerExtensions
|
@@ -8,13 +8,10 @@ class <%= migration_class_name %> < ActiveRecord::Migration
|
|
8
8
|
t.string :ip
|
9
9
|
t.text :user_agent
|
10
10
|
|
11
|
-
#
|
11
|
+
# traffic source
|
12
12
|
t.text :referrer
|
13
13
|
t.string :referring_domain
|
14
14
|
t.string :campaign
|
15
|
-
# t.string :social_network
|
16
|
-
# t.string :search_engine
|
17
|
-
# t.string :search_keyword
|
18
15
|
t.text :landing_page
|
19
16
|
|
20
17
|
# technology
|
@@ -1,14 +1,9 @@
|
|
1
|
-
/*
|
2
|
-
* Ahoy.js - 0.0.1
|
3
|
-
* Super simple visit tracking
|
4
|
-
* https://github.com/ankane/ahoy
|
5
|
-
* MIT License
|
6
|
-
*/
|
1
|
+
/*jslint browser: true, indent: 2, plusplus: true, vars: true */
|
7
2
|
|
8
3
|
(function () {
|
9
4
|
"use strict";
|
10
5
|
|
11
|
-
var debugMode =
|
6
|
+
var debugMode = false;
|
12
7
|
var visitTtl, visitorTtl;
|
13
8
|
|
14
9
|
if (debugMode) {
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ahoy_matey
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
@@ -96,6 +96,7 @@ files:
|
|
96
96
|
- app/controllers/ahoy/visits_controller.rb
|
97
97
|
- app/models/ahoy/visit.rb
|
98
98
|
- config/routes.rb
|
99
|
+
- lib/ahoy/controller_extensions.rb
|
99
100
|
- lib/ahoy/version.rb
|
100
101
|
- lib/ahoy_matey.rb
|
101
102
|
- lib/generators/ahoy/install_generator.rb
|