rack_google_tag_manager 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -5
- data/lib/rack/google_tag_manager/version.rb +1 -1
- data/lib/rack/google_tag_manager.rb +0 -1
- data/spec/lib/rack_google_tag_manager_spec.rb +0 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 495afeaac736fcb44e18c3b8dd1cabfb3f13b237
|
4
|
+
data.tar.gz: c92e9c8c5c58321d4db9947da5c617b50992c2ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c98ec973e8616c1c87f00b3af6094942f8bda8b29748ea24b7d7dda4ef16de42b2597fe9624d7af3352cd11a81c8151a26e74e447b23717143efa68823e7c5ef
|
7
|
+
data.tar.gz: 49c226d82fb43f6a59e3b4d5b4cdc3d10089b2482ededc900fcc541d14550ee4bf1322b8e87f1f3309ad25a7c7e2ed7f0481c7a920827fed5577546aed84685b
|
data/README.md
CHANGED
@@ -33,11 +33,14 @@ the existing ones.
|
|
33
33
|
|
34
34
|
In order for the `push` API so be usable, the *dataLayer* must first be
|
35
35
|
declared as an array, the GTM JavaScript snippet inserted at the
|
36
|
-
top of the body will declare it for
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
36
|
+
top of the body will declare it for you.
|
37
|
+
|
38
|
+
If your *tags* need to fire when pages load, but need information beyond URL
|
39
|
+
and referrer, you may need to define the *dataLayer* and pushes information to
|
40
|
+
it. Add this code above the container snippet so that the data layer information
|
41
|
+
is available on page load. Note that every page must have the code to create a
|
42
|
+
*dataLayer* and push information to it; the *dataLayer* does not persist across
|
43
|
+
pages.
|
41
44
|
|
42
45
|
## Contributing
|
43
46
|
|
@@ -48,7 +48,6 @@ module Rack
|
|
48
48
|
</noscript>
|
49
49
|
|
50
50
|
<script>
|
51
|
-
dataLayer = [];
|
52
51
|
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
53
52
|
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
54
53
|
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
@@ -12,10 +12,6 @@ module Rack
|
|
12
12
|
it 'adds the container snippet after body tag' do
|
13
13
|
expect(subject).to match(%r[<body.*?>.*#{tracker_id}.*Works!<\/body>]m)
|
14
14
|
end
|
15
|
-
|
16
|
-
it 'includes the dataLayer declaration' do
|
17
|
-
expect(subject).to include('dataLayer = []')
|
18
|
-
end
|
19
15
|
end
|
20
16
|
|
21
17
|
context 'for a text/html response with uppercase html tags' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack_google_tag_manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ancor Cruz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|