@spree/docs 0.1.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.
Files changed (183) hide show
  1. package/README.md +54 -0
  2. package/dist/api-reference/platform/authentication.md +38 -0
  3. package/dist/api-reference/store-api/authentication.md +188 -0
  4. package/dist/api-reference/store-api/errors.md +277 -0
  5. package/dist/api-reference/store-api/idempotency.md +129 -0
  6. package/dist/api-reference/store-api/introduction.md +34 -0
  7. package/dist/api-reference/store-api/localization.md +279 -0
  8. package/dist/api-reference/store-api/metadata.md +160 -0
  9. package/dist/api-reference/store-api/monetary-amounts.md +65 -0
  10. package/dist/api-reference/store-api/querying.md +399 -0
  11. package/dist/api-reference/store-api/rate-limitting.md +103 -0
  12. package/dist/api-reference/store-api/relations.md +185 -0
  13. package/dist/api-reference/storefront/authentication.md +88 -0
  14. package/dist/api-reference/tutorials/adyen-integration-guide-for-android.md +165 -0
  15. package/dist/api-reference/tutorials/adyen-integration-guide-for-ios.md +194 -0
  16. package/dist/api-reference/tutorials/quick-checkout-with-stripe.md +248 -0
  17. package/dist/api-reference/v2/fetching-multiple-resources.md +26 -0
  18. package/dist/api-reference/v2/filtering-and-sorting.md +53 -0
  19. package/dist/api-reference/v2/introduction.md +22 -0
  20. package/dist/api-reference/v2/pagination.md +37 -0
  21. package/dist/api-reference/webhooks-events.md +883 -0
  22. package/dist/developer/admin/admin.md +205 -0
  23. package/dist/developer/admin/authentication.md +59 -0
  24. package/dist/developer/admin/components.md +711 -0
  25. package/dist/developer/admin/custom-css.md +243 -0
  26. package/dist/developer/admin/custom-javascript.md +116 -0
  27. package/dist/developer/admin/extending-ui.md +1964 -0
  28. package/dist/developer/admin/form-builder.md +444 -0
  29. package/dist/developer/admin/helper-methods.md +531 -0
  30. package/dist/developer/admin/navigation.md +805 -0
  31. package/dist/developer/admin/tables.md +491 -0
  32. package/dist/developer/advanced/adding_spree_to_rails_app.md +106 -0
  33. package/dist/developer/cli/quickstart.md +137 -0
  34. package/dist/developer/contributing/creating-an-extension.md +258 -0
  35. package/dist/developer/contributing/developing-spree.md +339 -0
  36. package/dist/developer/contributing/quickstart.md +32 -0
  37. package/dist/developer/contributing/updating-extensions.md +67 -0
  38. package/dist/developer/core-concepts/addresses.md +265 -0
  39. package/dist/developer/core-concepts/adjustments.md +107 -0
  40. package/dist/developer/core-concepts/architecture.md +177 -0
  41. package/dist/developer/core-concepts/calculators.md +323 -0
  42. package/dist/developer/core-concepts/customers.md +230 -0
  43. package/dist/developer/core-concepts/events.md +624 -0
  44. package/dist/developer/core-concepts/imports-exports.md +698 -0
  45. package/dist/developer/core-concepts/inventory.md +191 -0
  46. package/dist/developer/core-concepts/markets.md +250 -0
  47. package/dist/developer/core-concepts/media.md +167 -0
  48. package/dist/developer/core-concepts/metafields.md +187 -0
  49. package/dist/developer/core-concepts/orders.md +328 -0
  50. package/dist/developer/core-concepts/payments.md +710 -0
  51. package/dist/developer/core-concepts/pricing.md +163 -0
  52. package/dist/developer/core-concepts/products.md +360 -0
  53. package/dist/developer/core-concepts/promotions.md +322 -0
  54. package/dist/developer/core-concepts/reports.md +206 -0
  55. package/dist/developer/core-concepts/search-filtering.md +237 -0
  56. package/dist/developer/core-concepts/shipments.md +212 -0
  57. package/dist/developer/core-concepts/slugs.md +111 -0
  58. package/dist/developer/core-concepts/staff-roles.md +123 -0
  59. package/dist/developer/core-concepts/store-credits-gift-cards.md +317 -0
  60. package/dist/developer/core-concepts/stores.md +117 -0
  61. package/dist/developer/core-concepts/taxes.md +135 -0
  62. package/dist/developer/core-concepts/translations.md +120 -0
  63. package/dist/developer/core-concepts/users.md +299 -0
  64. package/dist/developer/core-concepts/webhooks.md +378 -0
  65. package/dist/developer/create-spree-app/quickstart.md +158 -0
  66. package/dist/developer/customization/api.md +93 -0
  67. package/dist/developer/customization/authentication.md +88 -0
  68. package/dist/developer/customization/checkout.md +204 -0
  69. package/dist/developer/customization/configuration.md +55 -0
  70. package/dist/developer/customization/decorators.md +523 -0
  71. package/dist/developer/customization/dependencies.md +232 -0
  72. package/dist/developer/customization/emails.md +21 -0
  73. package/dist/developer/customization/extensions.md +92 -0
  74. package/dist/developer/customization/metadata.md +236 -0
  75. package/dist/developer/customization/model-preferences.md +130 -0
  76. package/dist/developer/customization/permissions.md +265 -0
  77. package/dist/developer/customization/quickstart.md +229 -0
  78. package/dist/developer/customization/routes.md +24 -0
  79. package/dist/developer/customization/v4/admin-panel.md +78 -0
  80. package/dist/developer/customization/v4/authentication.md +210 -0
  81. package/dist/developer/customization/v4/checkout.md +212 -0
  82. package/dist/developer/customization/v4/deface.md +251 -0
  83. package/dist/developer/customization/v4/images.md +86 -0
  84. package/dist/developer/customization/v4/storefront.md +450 -0
  85. package/dist/developer/deployment/assets.md +87 -0
  86. package/dist/developer/deployment/aws.md +335 -0
  87. package/dist/developer/deployment/caching.md +27 -0
  88. package/dist/developer/deployment/cdn.md +39 -0
  89. package/dist/developer/deployment/database.md +155 -0
  90. package/dist/developer/deployment/docker.md +128 -0
  91. package/dist/developer/deployment/emails.md +77 -0
  92. package/dist/developer/deployment/environment_variables.md +111 -0
  93. package/dist/developer/deployment/heroku.md +51 -0
  94. package/dist/developer/deployment/render.md +95 -0
  95. package/dist/developer/getting-started/quickstart.md +82 -0
  96. package/dist/developer/how-to/custom-payment-method.md +374 -0
  97. package/dist/developer/how-to/custom-promotion.md +373 -0
  98. package/dist/developer/how-to/custom-report.md +387 -0
  99. package/dist/developer/how-to/custom-search-provider.md +230 -0
  100. package/dist/developer/multi-store/quickstart.md +71 -0
  101. package/dist/developer/multi-store/setup.md +38 -0
  102. package/dist/developer/multi-tenant/configuration.md +41 -0
  103. package/dist/developer/multi-tenant/core-concepts.md +75 -0
  104. package/dist/developer/multi-tenant/installation.md +96 -0
  105. package/dist/developer/multi-tenant/quickstart.md +20 -0
  106. package/dist/developer/multi-vendor/installation.md +45 -0
  107. package/dist/developer/multi-vendor/quickstart.md +17 -0
  108. package/dist/developer/sdk/admin/quickstart.md +22 -0
  109. package/dist/developer/sdk/authentication.md +89 -0
  110. package/dist/developer/sdk/configuration.md +225 -0
  111. package/dist/developer/sdk/quickstart.md +82 -0
  112. package/dist/developer/sdk/store/account.md +67 -0
  113. package/dist/developer/sdk/store/cart-checkout.md +140 -0
  114. package/dist/developer/sdk/store/markets.md +151 -0
  115. package/dist/developer/sdk/store/payments.md +96 -0
  116. package/dist/developer/sdk/store/products.md +149 -0
  117. package/dist/developer/sdk/store/wishlists.md +52 -0
  118. package/dist/developer/security/pci_compliance.md +15 -0
  119. package/dist/developer/security/security_policy.md +68 -0
  120. package/dist/developer/storefront/blocks.md +285 -0
  121. package/dist/developer/storefront/custom-css.md +260 -0
  122. package/dist/developer/storefront/custom-javascript.md +166 -0
  123. package/dist/developer/storefront/helper-methods.md +1288 -0
  124. package/dist/developer/storefront/links.md +298 -0
  125. package/dist/developer/storefront/nextjs/architecture.md +150 -0
  126. package/dist/developer/storefront/nextjs/customization.md +141 -0
  127. package/dist/developer/storefront/nextjs/deployment.md +180 -0
  128. package/dist/developer/storefront/nextjs/quickstart.md +92 -0
  129. package/dist/developer/storefront/nextjs/spree-next-package.md +314 -0
  130. package/dist/developer/storefront/pages.md +163 -0
  131. package/dist/developer/storefront/sections.md +569 -0
  132. package/dist/developer/storefront/storefront.md +56 -0
  133. package/dist/developer/storefront/themes.md +161 -0
  134. package/dist/developer/tutorial/admin.md +134 -0
  135. package/dist/developer/tutorial/extending-models.md +380 -0
  136. package/dist/developer/tutorial/file-uploads.md +121 -0
  137. package/dist/developer/tutorial/introduction.md +33 -0
  138. package/dist/developer/tutorial/model.md +41 -0
  139. package/dist/developer/tutorial/page-builder.md +487 -0
  140. package/dist/developer/tutorial/rich-text.md +73 -0
  141. package/dist/developer/tutorial/seo.md +332 -0
  142. package/dist/developer/tutorial/storefront.md +352 -0
  143. package/dist/developer/tutorial/testing.md +558 -0
  144. package/dist/developer/upgrades/2.0-to-2.1.md +46 -0
  145. package/dist/developer/upgrades/2.1-to-2.2.md +59 -0
  146. package/dist/developer/upgrades/2.2-to-2.3.md +44 -0
  147. package/dist/developer/upgrades/2.3-to-2.4.md +42 -0
  148. package/dist/developer/upgrades/3.0-to-3.1.md +47 -0
  149. package/dist/developer/upgrades/3.1-to-3.2.md +34 -0
  150. package/dist/developer/upgrades/3.2-to-3.3.md +70 -0
  151. package/dist/developer/upgrades/3.3-to-3.4.md +36 -0
  152. package/dist/developer/upgrades/3.4-to-3.5.md +44 -0
  153. package/dist/developer/upgrades/3.5-to-3.6.md +40 -0
  154. package/dist/developer/upgrades/3.6-to-3.7.md +62 -0
  155. package/dist/developer/upgrades/3.7-to-4.0.md +152 -0
  156. package/dist/developer/upgrades/4.0-to-4.1.md +92 -0
  157. package/dist/developer/upgrades/4.1-to-4.2.md +109 -0
  158. package/dist/developer/upgrades/4.10-to-5.0.md +129 -0
  159. package/dist/developer/upgrades/4.2-to-4.3.md +100 -0
  160. package/dist/developer/upgrades/4.3-to-4.4.md +125 -0
  161. package/dist/developer/upgrades/4.4-to-4.5.md +94 -0
  162. package/dist/developer/upgrades/4.5-to-4.6.md +119 -0
  163. package/dist/developer/upgrades/4.6-to-4.7.md +39 -0
  164. package/dist/developer/upgrades/4.8-to-4.9.md +24 -0
  165. package/dist/developer/upgrades/4.9-to-4.10.md +24 -0
  166. package/dist/developer/upgrades/4.x-to-4.8.md +52 -0
  167. package/dist/developer/upgrades/5.0-to-5.1.md +28 -0
  168. package/dist/developer/upgrades/5.1-to-5.2.md +127 -0
  169. package/dist/developer/upgrades/5.2-to-5.3.md +338 -0
  170. package/dist/developer/upgrades/5.3-to-5.4.md +248 -0
  171. package/dist/developer/upgrades/quickstart.md +36 -0
  172. package/dist/integrations/analytics/google-analytics.md +64 -0
  173. package/dist/integrations/analytics/google-tag-manager.md +78 -0
  174. package/dist/integrations/integrations.md +39 -0
  175. package/dist/integrations/marketing/klaviyo.md +99 -0
  176. package/dist/integrations/payments/adyen.md +90 -0
  177. package/dist/integrations/payments/paypal.md +41 -0
  178. package/dist/integrations/payments/razorpay.md +45 -0
  179. package/dist/integrations/payments/stripe.md +109 -0
  180. package/dist/integrations/search/meilisearch.md +236 -0
  181. package/dist/integrations/sso-mfa-social-login/admin-dashboard.md +57 -0
  182. package/dist/integrations/sso-mfa-social-login/storefront.md +56 -0
  183. package/package.json +27 -0
@@ -0,0 +1,248 @@
1
+ ---
2
+ title: Upgrading to Spree 5.4
3
+ description: This guide covers upgrading a Spree 5.3 application to Spree 5.4.
4
+ ---
5
+
6
+ > **INFO:** Before proceeding to upgrade, please ensure you're at [Spree 5.3](/developer/upgrades/5.2-to-5.3)
7
+
8
+ ## Upgrade steps
9
+
10
+ ### Remove `spree_sample` gem from your Gemfile
11
+
12
+ Samples are now included in the `spree` gem. If you've added previously `spree_sample` to your Gemfile, remove it by running:
13
+
14
+ ```bash
15
+ bundle remove spree_sample
16
+ ```
17
+
18
+ ### Update gems
19
+
20
+ ```bash
21
+ bundle update
22
+ ```
23
+
24
+ ### Fetch and run missing migrations
25
+
26
+ ```bash
27
+ bin/rake spree:install:migrations && bin/rails db:migrate
28
+ ```
29
+
30
+ ### Backfill Image Thumbnail IDs
31
+
32
+ Spree 5.4 adds a `thumbnail` association to both `Product` and `Variant` models. This greatly speeds up rendering Product lists everywhere (API, Admin Dashboard and `spree_storefront`), as previously we've had to load all images for each product.
33
+
34
+ This can be done by running the following command:
35
+
36
+ ```bash
37
+ bin/rails spree:images:backfill_thumbnails
38
+ ```
39
+
40
+ As above, this process can take a while depending on the size of your product catalog.
41
+
42
+ ### Prefixed IDs
43
+
44
+ Spree 5.4 by default uses prefixed IDs for resources (eg. `prod_6VsgxZbenF`) instead of just IDs from the database. These IDs are now used in Admin Dashboard, API v3, Events system and Webhooks.
45
+
46
+ #### Event Subscribers
47
+
48
+ If you previously added Subscribers for Events, eg. `order.completed` with code such as:
49
+
50
+ ```ruby
51
+ module MyApp
52
+ class OrderAuditSubscriber < Spree::Subscriber
53
+ subscribes_to 'order.complete'
54
+
55
+ on 'order.complete', :log_order_completed
56
+
57
+ private
58
+
59
+ def find_order(event)
60
+ Spree::Order.find(event.payload[:id])
61
+ end
62
+ end
63
+ end
64
+ ```
65
+
66
+ You will need to update your code to use the new prefixed IDs, from:
67
+
68
+ ```ruby
69
+ Spree::Order.find(event.payload[:id])
70
+ ```
71
+
72
+ to:
73
+
74
+ ```ruby
75
+ Spree::Order.find_by_prefix_id!(event.payload[:id])
76
+ ```
77
+
78
+ You can also use `find_by_prefix_id` without the bang (`!`) to gracefully handle cases where the record might not exist.
79
+
80
+ #### Adding Prefixed IDs support to your custom models
81
+
82
+ All models inheriting from `Spree::Base` (or `Spree.base_class`) can support Prefixed IDs by adding the following code to your model:
83
+
84
+ ```ruby
85
+ class MyModel < Spree::Base
86
+ has_prefix_id :mm
87
+
88
+ # ...
89
+ end
90
+ ```
91
+
92
+ Prefix length isn't limited by default, but we recommend to keep it short.
93
+
94
+ ### Migrate Checkout Zones to Markets
95
+
96
+ Spree 5.4 introduces [Markets](/developer/core-concepts/markets) as the primary way to manage which countries are available for checkout, along with their currencies and locales. The legacy `checkout_zone` field on the Store model is now deprecated and will be removed in Spree 5.5.
97
+
98
+ New stores automatically get a default market created from their `default_country` — no manual setup needed. For existing stores that used `checkout_zone`, run the migration rake task:
99
+
100
+ ```bash
101
+ bin/rake spree:markets:migrate_checkout_zones
102
+ ```
103
+
104
+ This will:
105
+ 1. Read the `checkout_zone` countries from each store
106
+ 2. Create a default Market with those countries, currency, and locale
107
+ 3. Clear the `checkout_zone_id` column
108
+
109
+ > **WARNING:** You will need to run this rake task locally and on your production environment. After running, verify your markets are set up correctly in the Admin Dashboard under **Settings → Markets**.
110
+
111
+ #### Deprecated Store methods
112
+
113
+ The following Store methods now emit deprecation warnings and will be removed in Spree 5.5:
114
+
115
+ | Deprecated method | Replacement |
116
+ |---|---|
117
+ | `store.checkout_zone` | Use [Markets](/developer/core-concepts/markets) to manage countries |
118
+ | `store.checkout_zone=` | Use [Markets](/developer/core-concepts/markets) to manage countries |
119
+
120
+ The `store.default_country` reader now returns the first country (by name) from the store's default market. The `store.default_country_iso=` setter still works and is used to set the country when creating a store — a default market is automatically created from it.
121
+
122
+ #### Code that references `checkout_zone` for tax
123
+
124
+ If your application used `store.checkout_zone` as a tax zone fallback, update it to use `Spree::Zone.default_tax` instead:
125
+
126
+ ```ruby
127
+ # Before
128
+ zone = current_store.checkout_zone
129
+
130
+ # After
131
+ zone = Spree::Zone.default_tax
132
+ ```
133
+
134
+ ### ActiveMerchant removed from Spree Core
135
+
136
+ Spree 5.4 no longer depends on the `activemerchant` gem. All internal usages have been replaced with lightweight Spree-native classes:
137
+
138
+ | ActiveMerchant class | Spree replacement |
139
+ |---|---|
140
+ | `ActiveMerchant::Billing::Response` | `Spree::PaymentResponse` |
141
+ | `ActiveMerchant::ConnectionError` | `Spree::PaymentConnectionError` |
142
+
143
+ `Spree::PaymentResponse` is a drop-in replacement with the same constructor signature:
144
+
145
+ ```ruby
146
+ Spree::PaymentResponse.new(success, message, params = {}, options = {})
147
+ ```
148
+
149
+ It supports the same methods: `success?`, `message`, `params`, `authorization`, `avs_result`, `cvv_result`, `test?`, and YAML serialization (for log entries).
150
+
151
+ #### Updating custom payment methods
152
+
153
+ If you have a custom payment method (gateway) that returns `ActiveMerchant::Billing::Response`, update it to return `Spree::PaymentResponse` instead:
154
+
155
+ ```ruby
156
+ # Before
157
+ def authorize(money, source, options = {})
158
+ # ...
159
+ ActiveMerchant::Billing::Response.new(true, 'Success', {},
160
+ authorization: transaction_id, test: test?)
161
+ end
162
+
163
+ # After
164
+ def authorize(money, source, options = {})
165
+ # ...
166
+ Spree::PaymentResponse.new(true, 'Success', {},
167
+ authorization: transaction_id, test: test?)
168
+ end
169
+ ```
170
+
171
+ If your gateway rescues `ActiveMerchant::ConnectionError`, update it to rescue `Spree::PaymentConnectionError`:
172
+
173
+ ```ruby
174
+ # Before
175
+ rescue ActiveMerchant::ConnectionError => e
176
+
177
+ # After
178
+ rescue Spree::PaymentConnectionError => e
179
+ ```
180
+
181
+ #### Using `spree_gateway` or other ActiveMerchant-based extensions
182
+
183
+ If you use the [`spree_gateway`](https://github.com/spree/spree_gateway) gem or another extension that depends on ActiveMerchant, add `activemerchant` directly to your application's `Gemfile`:
184
+
185
+ ```ruby
186
+ gem 'activemerchant'
187
+ ```
188
+
189
+ These extensions will continue to work — Spree's `LogEntry#parsed_details` still deserializes `ActiveMerchant::Billing::Response` objects when the gem is present.
190
+
191
+ #### Address hash method renamed
192
+
193
+ `Spree::Address#active_merchant_hash` has been renamed to `#gateway_hash`. A backwards-compatible alias is provided, so existing code continues to work without changes.
194
+
195
+ ### (Optional) Install API v2
196
+
197
+ Spree 5.4 ships with API v3, which marks deprecation of API v2. API v2 is still available but you need to install it separately. If you currently use API v2, you can do this by running the following command:
198
+
199
+ ```bash
200
+ bundle add spree_legacy_api_v2
201
+ ```
202
+
203
+ If you have tests for API v2 endpoints in your application, you will need to include some files in your `rails_helper.rb`:
204
+
205
+ ```ruby
206
+ require 'jsonapi/rspec'
207
+ require 'spree_legacy_api_v2/testing_support/v2/base'
208
+ require 'spree_legacy_api_v2/testing_support/factories'
209
+ require 'spree_legacy_api_v2/testing_support/v2/current_order'
210
+ require 'spree_legacy_api_v2/testing_support/v2/platform_contexts'
211
+ require 'spree_legacy_api_v2/testing_support/v2/serializers_params'
212
+
213
+ RSpec.configure do |config|
214
+ config.include JSONAPI::RSpec, type: :request # required for API v2 request specs
215
+ end
216
+ ```
217
+
218
+ Also, add `jsonapi-rspec` gem to your `Gemfile`:
219
+
220
+ ```ruby
221
+ gem 'jsonapi-rspec', group: :test
222
+ ```
223
+
224
+ And run `bundle install`
225
+
226
+ ### (Optional) Install Spree Multi Store
227
+
228
+ Multi-store features like multiple store management & custom domains were moved to a separate gem `spree_multi_store`.
229
+
230
+ If you rely on these features please run:
231
+
232
+ ```bash
233
+ bundle add spree_multi_store
234
+ ```
235
+
236
+ ### (Optional) Install Legacy Product Properties
237
+
238
+ Product Properties have been extracted from Spree core to a separate gem `spree_legacy_product_properties`. Product Properties were already deprecated in favor of [Metafields](/developer/core-concepts/metafields) and disabled by default since Spree 5.1.
239
+
240
+ If you have `product_properties_enabled: true` in your Spree configuration or rely on Product Properties in any way, install the extension:
241
+
242
+ ```bash
243
+ bundle add spree_legacy_product_properties
244
+ ```
245
+
246
+ No data migration is needed — the gem uses the same database tables. All existing product properties, property definitions, and associations will continue to work as before.
247
+
248
+ > **WARNING:** If you skip this step and had Product Properties enabled, any code referencing `product.product_properties`, `product.property()`, `product.set_property()`, or the admin Properties page will stop working.
@@ -0,0 +1,36 @@
1
+ ---
2
+ title: Quickstart
3
+ description: Learn how to upgrade your Spree application
4
+ ---
5
+
6
+ Keeping your Spree installation up-to-date is essential to keep it safe and secure. Each Spree version brings new features, enhancements and bug fixes so it's greatly beneficial for you and your clients to upgrade frequently.
7
+
8
+ The upgrade process is fairly easy and well described. Of course, it all boils down to the level of customizations and the way you've customized your Spree applications.
9
+
10
+ We strongly advise upgrading Spree incrementally, rather than in one big go.
11
+
12
+ ## Support
13
+
14
+ If you're stuck and would want to get some professional help, you can [contact us directly](https://spreecommerce.org/contact/) and request a quote for our consulting services.
15
+
16
+ ## Release types
17
+
18
+ Spree development follows a shifted version of [Semantic Versioning](https://semver.org/):
19
+
20
+ **Patch Z, eg. 4.2.1**
21
+
22
+ Only bug fixes, no API changes, no new features. Except as necessary for security fixes.
23
+
24
+ **Minor Y, eg. 4.2.0**
25
+
26
+ New features, may contain API changes Serve as major versions of Semver. Breaking changes are paired with deprecation notices in the previous minor or major release.
27
+
28
+ **Major X, eg. 4.0.0**
29
+
30
+ New features, will likely contain API changes. The difference between Spree minor and major releases is the magnitude of breaking changes and is usually reserved for special occasions.
31
+
32
+ ## Security
33
+
34
+ Our Security policy is [described here](/developer/security).
35
+
36
+ When a release series is no longer supported, it's your own responsibility to deal with bugs and security issues. We may provide backports of some critical security fixes.
@@ -0,0 +1,64 @@
1
+ ---
2
+ title: "Connect Google Analytics 4 to Spree Commerce"
3
+ sidebarTitle: Google Analytics 4
4
+ description: "Learn how to set up and manage Spree’s native Google Analytics 4 integration."
5
+ ---
6
+
7
+ Spree Commerce comes with a native Google Analytics 4 integration that allows you to track user behavior, sales performance, and marketing effectiveness across your store. 
8
+
9
+ With minimal setup required, you can gain valuable insights into how visitors interact with your site, which can help you make informed decisions to improve conversions, user experience, and overall business strategy.
10
+
11
+ > **WARNING:** To set up the Google Analytics integration, you must have a Google Analytics account and an associated property.
12
+
13
+ ## Installation
14
+
15
+ Before you can enable Google Analytics 4, it must be installed. To do so, you need to run the following command:
16
+
17
+ ```bash
18
+ bundle add spree_google_analytics && bundle exec rails g spree_google_analytics:install
19
+ ```
20
+
21
+ After that, make sure to restart your server if it was running.
22
+
23
+ ## Connect Google Analytics
24
+
25
+ Sign in to your Spree admin dashboard and navigate to the **Integrations** tab.
26
+
27
+ ![](/images/integrations/google-analytics/1.get_started.png)
28
+
29
+ Locate the Google Analytics tile under Analytics, and click **Connect Google Analytics**.
30
+
31
+ This will redirect you to the setup page for Google Analytics integration.
32
+
33
+ ![](/images/integrations/google-analytics/2.setup_form.png)
34
+
35
+ Simply enter the **Measurement ID** from your Google Analytics account into the field and click **Create** to finalize the integration.
36
+
37
+ > **NOTE:** You can find the **Measurement ID** in the Home screen of your Google Analytics dashboard, if no data has been collected yet. Otherwise, it can be found by navigating to Admin settings \> Data Streams and then clicking on the property associated with your Spree site.
38
+
39
+ ![](/images/integrations/google-analytics/3.integration_added.png)
40
+
41
+ ## Event Tracking
42
+
43
+ By default, the following events will be tracked in Google Analytics:
44
+
45
+ - page_view
46
+ - first_visit
47
+ - session_start
48
+ - user_engagement
49
+ - search
50
+ - add_payment_info
51
+ - add_shipping_info
52
+ - add_to_cart
53
+ - add_to_wishlist
54
+ - begin_checkout
55
+ - purchase
56
+ - remove_from_cart
57
+ - view_cart
58
+ - view_item
59
+
60
+ ## Manage Your Integration
61
+
62
+ If you’d like to remove Google Analytics from your site, simply revisit the integration’s setup form and click **Delete** on the lower right hand side.
63
+
64
+ You can also switch out the Measurement ID if you’d like to switch the Google Analytics property that your site is connected to.
@@ -0,0 +1,78 @@
1
+ ---
2
+ title: "Connect Google Tag Manager to Spree Commerce"
3
+ sidebarTitle: Google Tag Manager
4
+ description: "Learn how to set up and manage Spree’s native Google Tag Manager integration."
5
+ ---
6
+
7
+ Google Tag Manager is a flexible tag management tool that lets you deploy and manage analytics, SEO, and marketing scripts across your store without editing code. You can connect services like Google Analytics 4, Google Ads, Meta Pixel, Microsoft Clarity, LinkedIn Insights, and Hotjar from one central workspace.
8
+
9
+ Spree makes it easy to connect your store to GTM and uses its ecommerce dataLayer to automatically push rich event data to your GTM container - no custom code required.
10
+
11
+ > **WARNING:** This integration allows you to use either Google Tag Manager or Google Analytics 4 - but not both at the same time. Only one key (GTM or GA4) should be active in the integration settings. If you plan to use GA4 with GTM, you must set up GA4 inside of your GTM workspace manually.
12
+
13
+ ## Requirements
14
+
15
+ To use this integration, you’ll need:
16
+
17
+ - An active Google Tag Manager account
18
+ - A GTM container set up for your store
19
+ - Any additional tools (e.g., Google Analytics 4, conversion tracking, custom tags) configured within GTM
20
+
21
+ Spree will automatically push ecommerce events to the dataLayer, but it’s up to you to configure tags and triggers in your GTM workspace.
22
+
23
+ ## Installation
24
+
25
+ Before you can enable Google Tag Manager, it must be installed. To do so, you need to run the following command:
26
+
27
+ ```bash
28
+ bundle add spree_google_analytics && bundle exec rails g spree_google_analytics:install
29
+ ```
30
+
31
+ After that, make sure to restart your server if it was running.
32
+
33
+ ## Connect Google Tag Manager
34
+
35
+ Sign in to your Spree admin dashboard and navigate to the Integrations tab.
36
+
37
+ ![](/images/integrations/google-tag-manager/1.integrations_tab.png)
38
+
39
+ Locate the Google Analytics tile under Analytics and click **Connect Google Analytics.**
40
+
41
+ This will redirect you to the setup page for Google Tag Manager integration.
42
+
43
+ ![](/images/integrations/google-tag-manager/2.gtm_form.png)
44
+
45
+ Select **Google Tag Manager** in the **Client Type** dropdown field, and paste your GTM Container ID (e.g., GTM-XXXXXXX) into the Google Tag Manager ID field.
46
+
47
+ > **NOTE:** Ignore the GA4 Measurement ID field - simply leave it blank.
48
+
49
+ ![](/images/integrations/google-tag-manager/3.gtm_id.png)
50
+
51
+ Finally, click **Create** to activate the integration.
52
+
53
+ ## Event Tracking
54
+
55
+ Spree sends a full suite of ecommerce events to the GTM dataLayer. This allows you to create triggers and tags based on:
56
+
57
+ - Product views
58
+ - Cart actions (add/remove)
59
+ - Checkout progress
60
+ - Payment info added
61
+ - Purchase confirmation
62
+ - Search activity
63
+ - Wishlist adds
64
+ - Newsletter signups
65
+ - User engagement (sessions, first visits, etc.)
66
+
67
+ To make use of these events, you'll need to configure appropriate tags and triggers inside your GTM container.
68
+
69
+ ## Manage Your Integration
70
+
71
+ To remove the integration or switch between GTM and GA4:
72
+
73
+ Return to the integration setup page in Spree and either:
74
+
75
+ - Clear the GTM field and enter a GA4 Measurement ID, or
76
+ - Click Delete in the lower-right corner to remove the integration completely
77
+
78
+ > **NOTE:** Only one analytics key should be set at a time (GA4 or GTM).
@@ -0,0 +1,39 @@
1
+ ---
2
+ title: "3rd party integrations"
3
+ sidebarTitle: "All Integrations"
4
+ description: "Learn how to connect your Spree application to third-party services and platforms."
5
+ ---
6
+
7
+ ## Payments
8
+
9
+
10
+ - [Stripe](/integrations/payments/stripe) — Stripe is a popular payment gateway that allows you to accept payments from your customers. Credit cards, wallets, buy-now-pay-later, installment payments and more.
11
+ - [Adyen](/integrations/payments/adyen) — Adyen is a global payment platform that enables businesses to accept payments across multiple channels and markets. Credit cards, digital wallets, BNPL, local payment methods, and more across 150+ currencies.
12
+ - [PayPal](/integrations/payments/paypal) — PayPal is an online payment system that allows you to send and receive money around the world. You can link your credit card, debit card, or bank account. You can also set up a PayPal Balance account.
13
+ - [RazorPay](/integrations/payments/razorpay) — Razorpay is a secure payment gateway that enables businesses to accept online payments via cards, UPI, net banking, and wallets. It also supports international transactions across multiple currencies.
14
+
15
+
16
+ ## Search
17
+
18
+
19
+ - [Meilisearch](/integrations/search/meilisearch) — One platform to build, scale, and unify search and AI retrieval. Search-as-you-type returns answers in less than 50 milliseconds. That's faster than the blink of an eye!
20
+
21
+
22
+ ## Analytics
23
+
24
+
25
+ - [Google Analytics 4](/integrations/analytics/google-analytics) — Google Analytics 4 is a powerful analytics tool that allows you to track user behavior, sales performance, and marketing effectiveness across your store.
26
+ - [Google Tag Manager](/integrations/analytics/google-tag-manager) — Google Tag Manager is a flexible tag management tool that lets you deploy and control marketing, analytics, and tracking scripts across your store.
27
+
28
+
29
+ ## Marketing
30
+
31
+
32
+ - [Klaviyo](/integrations/marketing/klaviyo) — Klaviyo is a marketing automation platform that allows you to send email campaigns to your customers.
33
+
34
+
35
+ ## SSO, MFA & Social Login
36
+
37
+
38
+ - [Admin Panel SSO & MFA](/integrations/sso-mfa-social-login/admin-dashboard) — Learn how to secure your Spree admin panel with SSO and MFA integration, using Microsoft Entra ID as an example.
39
+ - [Storefront SSO & Social Login](/integrations/sso-mfa-social-login/storefront) — Enable customer-facing SSO and social login on your Spree storefront, using Microsoft Entra External ID as an example.
@@ -0,0 +1,99 @@
1
+ ---
2
+ title: "Connect Klaviyo email marketing platform to Spree Commerce"
3
+ sidebarTitle: Klaviyo
4
+ description: "Learn how to set up and manage Spree's native Klaviyo integration."
5
+ ---
6
+
7
+ Klaviyo is a powerful marketing automation platform used for email and SMS campaigns. By connecting your store to Klaviyo, you can automatically track user interactions, build audience profiles, and grow your newsletter subscriber base - all without manual setup.
8
+
9
+ With Spree’s native integration, you can start collecting meaningful data for segmentation and automation with just a few clicks.
10
+
11
+ > **INFO:** You must have an existing Klaviyo account to connect this integration.
12
+
13
+ ## Installation
14
+
15
+ To install the Klaviyo integration, you need to run the following command:
16
+
17
+ ```bash
18
+ bundle add spree_klaviyo && bundle exec rails g spree_klaviyo:install
19
+ ```
20
+
21
+ After that, you need to make sure to restart the server.
22
+
23
+ ## Connect Klaviyo
24
+
25
+ Sign in to your Spree admin dashboard and navigate to the Integrations tab.
26
+
27
+ ![](/images/integrations/klaviyo/1.klaviyo.png)
28
+
29
+ To connect Klaviyo, locate the Klaviyo tile under the Marketing section and click Connect Klaviyo to open the setup form.
30
+
31
+ ![](/images/integrations/klaviyo/2.creation_form.png)
32
+
33
+ You’ll need to enter the following:
34
+
35
+ - **Public API Key**: This key identifies your account to Klaviyo.
36
+ - **Private API Key**: Used to authorize and securely send event and profile data.
37
+ - **Newsletter List ID**: The ID of the Klaviyo list you want to use for newsletter signups.
38
+ - This list will be used as the default newsletter list for customers signing up from the storefront or checkout.
39
+
40
+ Click **Create** to finalize the integration.
41
+
42
+ > **INFO:** You must configure your Private API Key in Klaviyo before you can finalize the integration (see below).
43
+
44
+ ## Configure API Key Permissions in Klaviyo
45
+
46
+ Before you can finalize the creation of your Klaviyo integration, you’ll need to create a Private API Key. To do so navigate to Settings → Account → API Keys in Klaviyo.
47
+
48
+ ![](/images/integrations/klaviyo/3.create_private_key.png)
49
+
50
+ Click Create Private API Key to open the key creation form.
51
+
52
+ ![](/images/integrations/klaviyo/4.configure_private_key.png)
53
+
54
+ When generating your Private API Key in Klaviyo, you must enable specific access scopes for the integration to function properly:
55
+
56
+ - **Events** - Read/Write Access
57
+ - **Lists** - Read/Write Access
58
+ - **Profiles** - Read/Write Access
59
+ - **Subscriptions** - Read/Write Access
60
+
61
+ You can configure this by selecting Custom Key during key configuration, then selecting the required scopes as mentioned above.
62
+
63
+ > **WARNING:** Without the appropriate access levels, some tracked events or newsletter subscriptions may fail to reach Klaviyo.
64
+
65
+ ## Event Tracking
66
+
67
+ Once the integration is connected, Spree automatically tracks the following customer events and sends them to Klaviyo:
68
+
69
+ - Product view
70
+ - Product list view
71
+ - Product search
72
+ - Product added to cart
73
+ - Product removed from cart
74
+ - Checkout step view
75
+ - Checkout step complete
76
+ - Coupon entered/removed
77
+ - Coupon applied/denied
78
+ - Checkout email entered
79
+ - Newsletter subscription
80
+ - Unsubscribe from newsletter
81
+ - Order Completed
82
+ - Package Shipped
83
+ - Cancelled Order
84
+
85
+ > **NOTE:** When a user subscribes to the newsletter on the storefront, they’re automatically added to the list you configured in the integration settings.
86
+
87
+ These events populate the Audience → Profiles section in Klaviyo, where you can view each user's tracked activity and properties. Lists used for newsletter subscriptions can be found in Audience → Lists & Segments.
88
+
89
+ ## Managing Your Integration
90
+
91
+ ![](/images/integrations/klaviyo/5.manage_integration.png)
92
+
93
+ After setup, you can revisit the integration form at any time to:
94
+
95
+ - **Edit keys** - useful if you want to swap out a list ID or rotate API keys.
96
+ - **Update configuration** - simply adjust the values and click Update.
97
+ - **Delete the integration** - click the Delete button in the bottom right of the form.
98
+
99
+ > **NOTE:** Removing the integration stops data from being sent to Klaviyo, but it won’t affect historical data already collected.
@@ -0,0 +1,90 @@
1
+ ---
2
+ title: "Connect Adyen payments to Spree Commerce"
3
+ sidebarTitle: Adyen
4
+ description: "Learn how to set up and manage Spree's native Adyen integration."
5
+ ---
6
+
7
+ Adyen is a global payment platform that enables businesses to accept payments across multiple channels and markets. It supports a wide range of payment methods, provides advanced fraud protection, and offers seamless checkout experiences for customers worldwide.
8
+
9
+ > **WARNING:** Adyen integration is currently in **private beta**. [Please contact us](https://spreecommerce.org/contact) to get access to the Adyen integration for your Spree store.
10
+
11
+ ## Installation
12
+
13
+ Before you can enable Adyen, it must be installed. To do so, you need to run the following command:
14
+
15
+ ```bash
16
+ bundle add spree_adyen --github spree/spree_adyen && bundle exec rails g spree_adyen:install
17
+ ```
18
+
19
+ After that, you need to make sure to restart the server.
20
+
21
+ ## Connect Adyen
22
+
23
+ Sign in to your Spree admin dashboard and navigate to **Settings → Payments**.
24
+
25
+ ![](/images/integrations/adyen/1.get_started.png)
26
+
27
+ Find Adyen under Available Payment Methods and click **Add**.
28
+
29
+ This will redirect you to the Adyen setup form.
30
+
31
+ ![](/images/integrations/adyen/2.setup_form.png)
32
+
33
+ In order to retrieve your API keys:
34
+ 1. Make sure to be logged into your Adyen Merchant Account
35
+ 2. Navigate to **Developers → API credentials**
36
+ 3. Configure a new **API credential**
37
+ 4. Copy the generated **API Key** (you won't be able to see it later)
38
+ 5. Click **Save changes**
39
+ 6. Paste the **API Key** into its respective field in the Adyen setup form in Spree
40
+ 7. Click **Create** to enable Adyen as a payment method on your store
41
+
42
+ ![](/images/integrations/adyen/3.adyen_enabled.png)
43
+
44
+ ### Additional Settings
45
+
46
+ ![](/images/integrations/adyen/4.additional_settings.png)
47
+
48
+ You can optionally configure the following settings for your Adyen payment method:
49
+
50
+ - **Name**: Customize the display name shown for this payment method on the storefront.
51
+ - **Display**: Choose where Adyen should be available:
52
+ - Storefront only
53
+ - Admin panel only
54
+ - Both (recommended)
55
+ - **Auto Capture**: Decide whether payments should be automatically captured at the time of authorization (recommended), or manually captured later.
56
+ - **Active Status**: Enable or disable the payment method. Inactive methods are hidden from checkout but not removed.
57
+
58
+ ### Test Mode
59
+
60
+ If you want to test your checkout flow without processing real payments, Adyen's test mode is a safe and effective way to simulate transactions. To enable it, simply switch your Adyen Customer Area to **Test mode** and paste the corresponding **test API credentials** into the payment method settings in Spree.
61
+
62
+ ## Features
63
+
64
+ Spree's native Adyen integration supports a comprehensive range of features and payment methods to help you offer a fast, secure, and flexible checkout experience:
65
+
66
+ - Support for 3D Secure and other security standards
67
+ - Support for off-session payments
68
+ - Support for Storefront API integration (see the API docs [here](/api-reference/storefront/adyen/create-an-adyen-payment-session))
69
+ - Accept payments in over 150 currencies
70
+ - Accept Credit Cards, Debit Cards, and Digital Wallets
71
+ - Accept Buy Now, Pay Later (BNPL) payments
72
+ - Accept Bank transfers and Direct Debit
73
+ - Accept Local payment methods (iDEAL, SOFORT, Bancontact, etc.)
74
+ - Accept Mobile payments (Apple Pay, Google Pay, Samsung Pay)
75
+ - Accept Cryptocurrency payments
76
+ - Advanced fraud protection and risk management
77
+ - Real-time payment status updates
78
+ - Comprehensive reporting and analytics
79
+
80
+ ### Storefront Display
81
+
82
+ Spree's Adyen integration enhances the customer experience with dynamic, context-aware payment options across the storefront:
83
+
84
+ - Dynamic payment method selection based on customer location
85
+ - Real-time payment method availability
86
+ - Seamless checkout experience with Adyen's Drop-in component
87
+ - Support for one-click payments and saved payment methods
88
+ - Mobile-optimized payment flows
89
+
90
+ Feel free to [reach out](https://spreecommerce.org/contact) to learn more.