caboose-cms 0.5.196 → 0.5.197

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZjM1ZjMxZmM0YzU4MjdmNDIyY2RhZWZkNjgyODIyMjRkZGI3ZmExYw==
4
+ YmNlZjNhZGU4Y2JlNDJmODYwYjNiODhhYjY2ZGFlYjE3YjM5MjUyYw==
5
5
  data.tar.gz: !binary |-
6
- MDA3YjM5NDk0Y2E2ODlhZDM0YjQyMzMwMmZlMDJlNDA0NzgzYWIxYQ==
6
+ MzAzOWQ1NjlmYTE2ODBhYjQ1NGIzNDNmZjBiN2NjZGFhMGJlYzQzOQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OGEzN2I1Nzc0YWU4NWM4YWY0OTMwMTQ2NWZiMGY3ZDFkNmI4MWY5ZjdhYWNj
10
- OWEzYThjMGM0OGZiYmE5MDEzOTAxMDg3N2QzYWI4Yjg3YjIxN2RkNTA5N2Yx
11
- NGM0MmJkM2U4OTExN2QxM2M1YWJlNzMyN2EwMWQwNTU1NzkxMjY=
9
+ YzFkNmE2MmQ1NzlmMTBlYWMwNWI3ODNhNTg5YzFmOWE5OTlkODhkNWUxODk0
10
+ ZDIxNWE3MDdiN2VhMmJhNDU0MWM2ODA3NmUyMWIyYzJjMmFiNGY5YzMzZWE2
11
+ NmE5MGFhOTg4ZmQ0MDZlN2Y4YWJmMGQxMmNiNTRhMTMwNjVhYzY=
12
12
  data.tar.gz: !binary |-
13
- NzE2Y2YyOWNiMTIwNDIzNmExNDhmMjNiNjE4NTBmOWJjZjFmZjU0NDcyMjlh
14
- YTFkNDNjNmFhM2NlNjFkOWQ0MGNmZjZiM2YyNTYyODU1M2U0NTMyMmE4YjNi
15
- MjM2MzFjNTg3MWE1MTc5ZTY2YWZhYWQ3ODNkYmQzNWNkY2JiYTg=
13
+ OWUxNzZmZDY2ZWY5NzA4ZWU1YTQ1NjQyNjEyNTUxMTIxMjg4NGVmMDRlNTA0
14
+ ZjI5ZmIwMDBhMTk0ZTYzOWVkMzJhZjdkZWIyNGQzN2JlZTM5MWUwNGJlYTY1
15
+ ZWE3YzI0NmFmOWZlMzg2MTY4OGRiYTkzYWVjZGVkODg2N2JmNGU=
@@ -29,7 +29,7 @@ module Caboose
29
29
  case name
30
30
  when 'conversion_id' then rc.conversion_id = value
31
31
  when 'labels_function' then rc.labels_function = value
32
- when 'fb_pixels_function' then rc.fb_pixels_function = value
32
+ when 'fb_pixel_id' then rc.fb_pixel_id = value
33
33
  end
34
34
  end
35
35
 
@@ -7,7 +7,7 @@ module Caboose
7
7
  :site_id,
8
8
  :conversion_id,
9
9
  :labels_function,
10
- :fb_pixels_function
10
+ :fb_pixel_id
11
11
 
12
12
  def labels(request, page)
13
13
  return [] if self.labels_function.nil? || self.labels_function.strip.length == 0
@@ -16,15 +16,7 @@ module Caboose
16
16
  return [] if arr.nil?
17
17
  return [arr] if arr is_a? String
18
18
  return arr
19
- end
20
-
21
- def fb_pixels(request, page)
22
- return [] if self.fb_pixels_function.nil? || self.fb_pixels_function.strip.length == 0
23
- arr = eval(self.fb_pixels_function)
24
- return [] if arr.nil?
25
- return [arr] if arr.is_a?(String) || arr.is_a?(Integer)
26
- return arr
27
- end
19
+ end
28
20
 
29
21
  end
30
22
  end
@@ -77,6 +77,7 @@ class Caboose::Schema < Caboose::Utilities::Schema
77
77
  :decremented
78
78
  ],
79
79
  #Caboose::PageCache => [:block],
80
+ #Caboose::RetargetingConfig => [:fb_pixels_function],
80
81
  Caboose::ShippingPackage => [:price, :carrier, :service_code, :service_name, :shipping_method_id, :length, :width, :height],
81
82
  Caboose::Site => [:shipping_cost_function],
82
83
  Caboose::StoreConfig => [:use_usps, :allowed_shipping_codes, :default_shipping_code, :pp_relay_url, :pp_response_url],
@@ -506,7 +507,7 @@ class Caboose::Schema < Caboose::Utilities::Schema
506
507
  [ :site_id , :integer ],
507
508
  [ :conversion_id , :string ],
508
509
  [ :labels_function , :text ],
509
- [ :fb_pixels_function , :text ]
510
+ [ :fb_pixel_id , :string ]
510
511
  ],
511
512
  Caboose::Review => [
512
513
  [ :product_id , :integer ],
@@ -19,8 +19,8 @@
19
19
  </noscript>
20
20
  <% end %>
21
21
  <%
22
- # Facebook audiences
23
- %><% rc.fb_pixels(request, page).each do |pixel_id| %>
22
+ # Facebook audiences
23
+ %><% if rc.fb_pixel_id && rc.fb_pixel_id.strip.length > 0 %>
24
24
  <script>(function() {
25
25
  var _fbq = window._fbq || (window._fbq = []);
26
26
  if (!_fbq.loaded) {
@@ -31,11 +31,11 @@
31
31
  s.parentNode.insertBefore(fbds, s);
32
32
  _fbq.loaded = true;
33
33
  }
34
- _fbq.push(['addPixelId', '<%= raw pixel_id %>']);
34
+ _fbq.push(['addPixelId', '<%= raw rc.fb_pixel_id %>']);
35
35
  })();
36
36
  window._fbq = window._fbq || [];
37
37
  window._fbq.push(['track', 'PixelInitialized', {}]);
38
38
  </script>
39
- <noscript><img height="1" width="1" alt="" style="display:none" src="https://www.facebook.com/tr?id=<%= raw pixel_id %>&amp;ev=PixelInitialized" /></noscript>
39
+ <noscript><img height="1" width="1" alt="" style="display:none" src="https://www.facebook.com/tr?id=<%= raw rc.fb_pixel_id %>&amp;ev=PixelInitialized" /></noscript>
40
40
  <% end %>
41
41
  <% end %>
@@ -5,11 +5,9 @@ rc = s.retargeting_config
5
5
  <%= render :partial => 'caboose/sites/admin_header' %>
6
6
 
7
7
  <p><div id='site_<%= s.id %>_use_retargeting' ></div></p>
8
-
9
- <h2>Google Audiences</h2>
8
+ <p><div id='retargetingconfig_<%= rc.id %>_fb_pixel_id' ></div></p>
10
9
  <p><div id='retargetingconfig_<%= rc.id %>_conversion_id' ></div></p>
11
- <h3>Conversion Labels</h3>
12
- <p><code>def conversion_labels_function(request, page) {</code></p>
10
+ <p><code>def google_conversion_labels_function(request, page) {</code></p>
13
11
  <p><div id='retargetingconfig_<%= rc.id %>_labels_function' ></div></p>
14
12
  <p><code>
15
13
  &nbsp;&nbsp;# This function returns a conversion label string or an array of conversion label strings.<br />
@@ -19,18 +17,6 @@ rc = s.retargeting_config
19
17
  &nbsp;&nbsp;# return ["abc123", "xyz456"]<br />
20
18
  }</code></p>
21
19
 
22
- <h2>Facebook Pixel IDs</h2>
23
- <p><code>def facebook_pixel_ids(request, page) {</code></p>
24
- <p><div id='retargetingconfig_<%= rc.id %>_fb_pixels_function' ></div></p>
25
- <p><code>
26
- &nbsp;&nbsp;# This function returns a pixel ID string or an array of pixel ID strings.<br />
27
- &nbsp;&nbsp;# Example 1:<br />
28
- &nbsp;&nbsp;# return "abc123"<br />
29
- &nbsp;&nbsp;# Example 2: <br />
30
- &nbsp;&nbsp;# return ["abc123", "xyz456"]<br />
31
- &nbsp;&nbsp;# This function returns an array of conversion labels<br />
32
- }</code></p>
33
-
34
20
  <%= render :partial => 'caboose/sites/admin_footer' %>
35
21
 
36
22
  <% content_for :caboose_js do %>
@@ -52,9 +38,9 @@ $(document).ready(function() {
52
38
  update_url: "/admin/sites/<%= @site.id %>/retargeting",
53
39
  authenticity_token: '<%= form_authenticity_token %>',
54
40
  attributes: [
55
- { name: 'conversion_id' , nice_name: 'Conversion ID' , type: 'text' , value: <%= raw Caboose.json(rc.conversion_id ) %>, width: 600 },
56
- { name: 'labels_function' , nice_name: 'Conversion Labels Function' , type: 'textarea' , value: <%= raw Caboose.json(rc.labels_function ) %>, width: 600, height: 75, fixed_placeholder: false },
57
- { name: 'fb_pixels_function' , nice_name: 'Facebook Pixel IDs Function' , type: 'textarea' , value: <%= raw Caboose.json(rc.fb_pixels_function ) %>, width: 600, height: 75, fixed_placeholder: false }
41
+ { name: 'conversion_id' , nice_name: 'Google Conversion ID' , type: 'text' , value: <%= raw Caboose.json(rc.conversion_id ) %>, width: 600 },
42
+ { name: 'labels_function' , nice_name: 'Conversion Labels Function' , type: 'textarea' , value: <%= raw Caboose.json(rc.labels_function ) %>, width: 600, height: 75, fixed_placeholder: false },
43
+ { name: 'fb_pixel_id' , nice_name: 'Facebook Pixel ID' , type: 'text' , value: <%= raw Caboose.json(rc.fb_pixel_id ) %>, width: 600 }
58
44
  ]
59
45
  });
60
46
  });
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.5.196'
2
+ VERSION = '0.5.197'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.196
4
+ version: 0.5.197
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry