rack-tracker 1.9.0 → 1.10.0
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/CHANGELOG.md +4 -0
- data/README.md +15 -12
- data/lib/rack/tracker.rb +1 -0
- data/lib/rack/tracker/hubspot/hubspot.rb +2 -0
- data/lib/rack/tracker/hubspot/template/hubspot.erb +1 -0
- data/lib/rack/tracker/version.rb +1 -1
- data/spec/handler/hubspot_spec.rb +11 -0
- data/spec/integration/hubspot_integration_spec.rb +19 -0
- data/spec/support/metal_controller.rb +4 -0
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a933eccd9730dfd27db81c2f732ea830762451307897776f8063d7ea7fad50e
|
4
|
+
data.tar.gz: '0930fcfb478012d19570598db7b8931a25c81bbb4f2d1019c694c8a7c9a0da08'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: beb180ef84c7a6c76ad1ed38a7815cdd51c20022d07de6b48779d052b9ce8f6b8431f49d73e74289113cf459d5b1c8c54c159dcee5d9c79b9b8bb0e7378c53a6
|
7
|
+
data.tar.gz: c78cc4ae1977fbb49cc09a6f673941ed7905fc522fb8f3e7538fcd5e2d8bc2fdd0993d61dcaec338a1a553e1cc723c882ab18d948fdce667142e0bb09816eb81
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -18,18 +18,9 @@ rack middleware that can be hooked up to multiple services and exposing them in
|
|
18
18
|
fashion. It comes in two parts, the first one is the actual middleware that you can add
|
19
19
|
to the middleware stack the second part are the service-handlers that you're going to use
|
20
20
|
in your application. It's easy to add your own [custom handlers](#custom-handlers),
|
21
|
-
but to get you started we're shipping support for the
|
22
|
-
|
23
|
-
|
24
|
-
* [Google Analytics](#google-analytics)
|
25
|
-
* [Google Adwords Conversion](#google-adwords-conversion)
|
26
|
-
* [Google Tag Manager](#google-tag-manager)
|
27
|
-
* [Facebook](#facebook)
|
28
|
-
* [Visual Website Optimizer (VWO)](#visual-website-optimizer-vwo)
|
29
|
-
* [GoSquared](#gosquared)
|
30
|
-
* [Criteo](#criteo)
|
31
|
-
* [Zanox](#zanox)
|
32
|
-
* [Hotjar](#hotjar)
|
21
|
+
but to get you started we're shipping support for the services [mentioned below](#services)
|
22
|
+
out of the box:
|
23
|
+
|
33
24
|
|
34
25
|
## Respecting the Do Not Track (DNT) HTTP header
|
35
26
|
|
@@ -112,6 +103,8 @@ request.env['tracker'] = {
|
|
112
103
|
}
|
113
104
|
```
|
114
105
|
|
106
|
+
## Services
|
107
|
+
|
115
108
|
### Google Global Site Tag (gtag.js)
|
116
109
|
|
117
110
|
* `:anonymize_ip` - sets the tracker to remove the last octet from all IP addresses, see https://developers.google.com/analytics/devguides/collection/gtagjs/ip-anonymization for details.
|
@@ -601,6 +594,16 @@ tracker do |t|
|
|
601
594
|
end
|
602
595
|
```
|
603
596
|
|
597
|
+
### Hubspot
|
598
|
+
|
599
|
+
[Hubspot](https://www.hubspot.com/)
|
600
|
+
|
601
|
+
```
|
602
|
+
config.middleware.use(Rack::Tracker) do
|
603
|
+
handler :hubspot, { site_id: '1234' }
|
604
|
+
end
|
605
|
+
```
|
606
|
+
|
604
607
|
|
605
608
|
### Custom Handlers
|
606
609
|
|
data/lib/rack/tracker.rb
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
<script type="text/javascript" id="hs-script-loader" async defer src="//js.hs-scripts.com/<%= options[:site_id] %>.js"></script>
|
data/lib/rack/tracker/version.rb
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'support/capybara_app_helper'
|
2
|
+
|
3
|
+
RSpec.describe "Hubspot Integration" do
|
4
|
+
before do
|
5
|
+
setup_app(action: :hubspot) do |tracker|
|
6
|
+
tracker.handler :hubspot, { site_id: '123456' }
|
7
|
+
end
|
8
|
+
|
9
|
+
visit '/'
|
10
|
+
end
|
11
|
+
|
12
|
+
|
13
|
+
subject { page }
|
14
|
+
|
15
|
+
it "embeds the site-specifc script tag" do
|
16
|
+
expect(page).to have_xpath("//script", id: "hs-script-loader" )
|
17
|
+
expect(page.find("script")[:src]).to eq("//js.hs-scripts.com/123456.js")
|
18
|
+
end
|
19
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-tracker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lars Brillert
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-
|
12
|
+
date: 2019-06-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|
@@ -184,6 +184,8 @@ files:
|
|
184
184
|
- lib/rack/tracker/handler_delegator.rb
|
185
185
|
- lib/rack/tracker/hotjar/hotjar.rb
|
186
186
|
- lib/rack/tracker/hotjar/template/hotjar.erb
|
187
|
+
- lib/rack/tracker/hubspot/hubspot.rb
|
188
|
+
- lib/rack/tracker/hubspot/template/hubspot.erb
|
187
189
|
- lib/rack/tracker/javascript_helper.rb
|
188
190
|
- lib/rack/tracker/railtie.rb
|
189
191
|
- lib/rack/tracker/version.rb
|
@@ -210,6 +212,7 @@ files:
|
|
210
212
|
- spec/handler/google_tag_manager_spec.rb
|
211
213
|
- spec/handler/handler_spec.rb
|
212
214
|
- spec/handler/hotjar_spec.rb
|
215
|
+
- spec/handler/hubspot_spec.rb
|
213
216
|
- spec/handler/vwo_spec.rb
|
214
217
|
- spec/handler/zanox_spec.rb
|
215
218
|
- spec/integration/bing_integration_spec.rb
|
@@ -222,6 +225,7 @@ files:
|
|
222
225
|
- spec/integration/google_global_integration_spec.rb
|
223
226
|
- spec/integration/google_tag_manager_integration_spec.rb
|
224
227
|
- spec/integration/hotjar_integration_spec.rb
|
228
|
+
- spec/integration/hubspot_integration_spec.rb
|
225
229
|
- spec/integration/rails_integration_spec.rb
|
226
230
|
- spec/integration/vwo_integration_spec.rb
|
227
231
|
- spec/integration/zanox_integration_spec.rb
|
@@ -276,6 +280,7 @@ test_files:
|
|
276
280
|
- spec/handler/google_tag_manager_spec.rb
|
277
281
|
- spec/handler/handler_spec.rb
|
278
282
|
- spec/handler/hotjar_spec.rb
|
283
|
+
- spec/handler/hubspot_spec.rb
|
279
284
|
- spec/handler/vwo_spec.rb
|
280
285
|
- spec/handler/zanox_spec.rb
|
281
286
|
- spec/integration/bing_integration_spec.rb
|
@@ -288,6 +293,7 @@ test_files:
|
|
288
293
|
- spec/integration/google_global_integration_spec.rb
|
289
294
|
- spec/integration/google_tag_manager_integration_spec.rb
|
290
295
|
- spec/integration/hotjar_integration_spec.rb
|
296
|
+
- spec/integration/hubspot_integration_spec.rb
|
291
297
|
- spec/integration/rails_integration_spec.rb
|
292
298
|
- spec/integration/vwo_integration_spec.rb
|
293
299
|
- spec/integration/zanox_integration_spec.rb
|