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 +8 -8
- data/app/controllers/caboose/retargeting_controller.rb +1 -1
- data/app/models/caboose/retargeting_config.rb +2 -10
- data/app/models/caboose/schema.rb +2 -1
- data/app/views/caboose/blocks/_retargeting.html.erb +4 -4
- data/app/views/caboose/retargeting/admin_edit.html.erb +5 -19
- data/lib/caboose/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YmNlZjNhZGU4Y2JlNDJmODYwYjNiODhhYjY2ZGFlYjE3YjM5MjUyYw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MzAzOWQ1NjlmYTE2ODBhYjQ1NGIzNDNmZjBiN2NjZGFhMGJlYzQzOQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YzFkNmE2MmQ1NzlmMTBlYWMwNWI3ODNhNTg5YzFmOWE5OTlkODhkNWUxODk0
|
10
|
+
ZDIxNWE3MDdiN2VhMmJhNDU0MWM2ODA3NmUyMWIyYzJjMmFiNGY5YzMzZWE2
|
11
|
+
NmE5MGFhOTg4ZmQ0MDZlN2Y4YWJmMGQxMmNiNTRhMTMwNjVhYzY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
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 '
|
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
|
-
:
|
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
|
-
[ :
|
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.
|
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
|
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
|
39
|
+
<noscript><img height="1" width="1" alt="" style="display:none" src="https://www.facebook.com/tr?id=<%= raw rc.fb_pixel_id %>&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
|
-
<
|
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
|
# 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
|
# 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
|
-
# This function returns a pixel ID string or an array of pixel ID strings.<br />
|
27
|
-
# Example 1:<br />
|
28
|
-
# return "abc123"<br />
|
29
|
-
# Example 2: <br />
|
30
|
-
# return ["abc123", "xyz456"]<br />
|
31
|
-
# 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'
|
56
|
-
{ name: 'labels_function' , nice_name: 'Conversion Labels Function' , type: 'textarea' , value: <%= raw Caboose.json(rc.labels_function
|
57
|
-
{ name: '
|
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
|
});
|
data/lib/caboose/version.rb
CHANGED