johnhenry 1.0.16 → 1.0.17

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6bcdcd7232c350da398d0557599b4da5d1bcd257
4
- data.tar.gz: ad50480b88929a99918d9b1732020af026d0a932
3
+ metadata.gz: 7e635f4640ab31c1c31373852b4664b48347bf4d
4
+ data.tar.gz: 2e6c92bc11af6b739cccfdd49d19687ecfb1d5d9
5
5
  SHA512:
6
- metadata.gz: 024507c6ede4c28acd33da7b2290ad304b244e352d78c4519a2a2dbbcb06ba3e3a87244a64105e4883a3a5c4093e9074ca61b3d56807c9f6fa5e5d060475cbec
7
- data.tar.gz: c6023aa2e4e8548da4ec18c858e0f3e7d4f69bdfb02e1c560ec97a8e807d138589c186ae594fe5793fa0702a92d2e300bff7638143387b00b713065e7129e492
6
+ metadata.gz: 925460d88c9ed923f7010c71d13dfda1dc4365da6b237995ba6225bbb6f3a70e0ce88e46d122f2073092dc0025f25e971cfee5e48d040cfaaa2f06ca076d35c8
7
+ data.tar.gz: e9a5c77963afbfba41bcee2507e29c212d8117fb3991c8a29febd2ca9df993453a736881dbcfcf94d1f17484263b105c248203e620801e85cbacefc7b1c9c294
data/README.md CHANGED
@@ -108,6 +108,10 @@ heroku config:set \
108
108
  GOOGLE_ANALYTICS_DOMAIN=sampleproject.herokuapp.com \
109
109
  GOOGLE_ANALYTICS_UA=UA-56346779-1
110
110
  ```
111
+ If you want to track signups as a goal in Analytics (a good baseline), set up
112
+ a goal where the goal URL is `/signup=1`, because after going through a new
113
+ user flow will drop you at that URL.
114
+
111
115
  1. Google Webmaster Tools
112
116
  After setting up Google Analytics, it's easy to link to Webmaster tools:
113
117
  `https://www.google.com/webmasters/tools/home?hl=en`
@@ -162,6 +166,23 @@ heroku config:set NEW_RELIC_APP_NAME="SampleProject"
162
166
  git push heroku master
163
167
  ```
164
168
 
169
+ 1. Set up Google Adwords tracking:
170
+ AdWord's support topic: `https://support.google.com/adwords/answer/1722054?hl=en`
171
+ [![Screenshot](https://raw.github.com/derwiki/johnhenry/master/gaw-setup-conversion-tracking.jpg)](https://support.google.com/adwords/answer/1722054?hl=en)
172
+ At the end of the flow, you'll get a code snippet:
173
+ ![Screenshot](https://raw.github.com/derwiki/johnhenry/master/gaw-conversion-tracking.jpg)
174
+ The `google_conversion_id` and `google_conversion_label` are what we care about.
175
+ We're going to use those values to set environment variables that let our app
176
+ know what identifiers to send to AdWords:
177
+
178
+ ```bash
179
+ heroku config:set GOOGLE_CONVERSION_ID=1234 GOOGLE_CONVERSION_LABEL='abc'
180
+ ```
181
+
182
+ To verify that tracking is working properly, go through your sign up flow and
183
+ when you are dumped back on the homepage, view the page's source code. You
184
+ should see a `<!-- Google Code for signup Conversion Page -->` HTML comment
185
+ followed by the conversion snippet.
165
186
 
166
187
  1. Custom Bootstrap color theme:
167
188
  http://www.lavishbootstrap.com/
@@ -6,8 +6,20 @@ class Johnhenry::RegistrationsController < Devise::RegistrationsController
6
6
  render 'johnhenry/devise/registrations/new'
7
7
  end
8
8
 
9
+ def create
10
+ super
11
+
12
+ # tell the layout it can render a Google AdWords conversion event
13
+ flash[:gaw_conversion] = :signup
14
+ end
15
+
9
16
  private
10
17
 
18
+ # redirect with a query param that can be used as a Google Analytics goal
19
+ def after_sign_in_path_for(user)
20
+ '/?signup=1'
21
+ end
22
+
11
23
  def maybe_generate_password
12
24
  if params['user']['password'].blank? &&
13
25
  params['user']['password_confirmation'].blank?
@@ -0,0 +1,20 @@
1
+ <!-- Google Code for signup Conversion Page -->
2
+ <script type="text/javascript">
3
+ /* <![CDATA[ */
4
+ var google_conversion_id = <%= ENV['GOOGLE_CONVERSION_ID'] %>;
5
+ var google_conversion_language = "en";
6
+ var google_conversion_format = "3";
7
+ var google_conversion_color = "ffffff";
8
+ var google_conversion_label = "jQI3CPWO2QgQuZSi6AM";
9
+ var google_conversion_label = "<%= ENV['GOOGLE_CONVERSION_LABEL'] %>";
10
+ var google_conversion_value = 0;
11
+ var google_remarketing_only = false;
12
+ /* ]]> */
13
+ </script>
14
+ <script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
15
+ </script>
16
+ <noscript>
17
+ <div style="display:inline;">
18
+ <img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/1023969849/?value=0&amp;label=jQI3CPWO2QgQuZSi6AM&amp;guid=ON&amp;script=0"/>
19
+ </div>
20
+ </noscript>
@@ -52,6 +52,9 @@
52
52
  .col-md-12.alert.alert-warning
53
53
  = alert
54
54
  %a.pull-right.dismiss-flash{ href: '#' } ✕
55
+ - if flash[:gaw_conversion] == :signup
56
+ - if ENV['GOOGLE_CONVERSION_ID'] && ENV['GOOGLE_CONVERSION_LABEL']
57
+ .hide= render 'johnhenry/shared/gaw_conversion'
55
58
  = yield
56
59
 
57
60
  #footer.well.well-section
@@ -1,3 +1,3 @@
1
1
  module JohnHenry
2
- VERSION = '1.0.16'
2
+ VERSION = '1.0.17'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: johnhenry
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.16
4
+ version: 1.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Derewecki
@@ -212,6 +212,7 @@ files:
212
212
  - app/views/johnhenry/payments/show.json.jbuilder
213
213
  - app/views/johnhenry/shared/_form_row.html.haml
214
214
  - app/views/johnhenry/shared/_form_row_submit.html.haml
215
+ - app/views/johnhenry/shared/_gaw_conversion.html.erb
215
216
  - app/views/johnhenry/shared/_payment_form.html.haml
216
217
  - app/views/johnhenry/shared/_signin_form.html.haml
217
218
  - app/views/johnhenry/shared/_signup_form.html.haml