Push subscription renewal to dataLayer/be picked up by GTM - wordpress

I manage a wordpress site with WooCommerce, and I use gtm4wp. Everything else is mostly up and running, but is there a way to detect a WooCommerce automatic subscription renewal and send it to GTM/GA4? Furthermore, as I understand GA doesnt allow for personally identifying data, so would I be allowed to link automatic renewals of subscriptions to the same customer/subscriptions as the last renewal charge?
Also, how do I detect cancellation of subscriptions in GA4 through GTM and woocommerce?

Related

Send API after payment completed WooCommerce

I have an e-commerce on Wordpress where I put my products for sale through WooCommerce and a demand arose for an advantage club where, after payment was made, it would send data to an API to create an account on a platform and when is no longer paid to be deactivated by the same API. How can I do this? Is there any way?
I looked for documentation on the internet but I couldn't find much.
You can use, a hook that runs when an ordered is marked as completed:
woocommerce_order_status_completed
if that doesnt work for you, you need to check the payment gateway provider, to see what hooks they offer

Recurring and non-recurring items in single PayPal checkout flow

I'm currently migrating a website from WooCommerce to Shopware 6, which needs to support recurring payments for a membership subscription.
WooCommerce is still using PayPal Standard, which allows you to mix non-recurring line items with a recurring subscription, in a single checkout flow.
Shopware 6 uses the REST API, which doesn't appear to support this ability and the only solution appears to be using the Javascript SDK:
User clicks Pay with PayPal.
Subscription is created via actions.subscription.create
Dialog is displayed requesting approval.
Customer approves.
Submit original checkout.
Redirect to PayPal.
Complete payment.
Redirect back to website with confirmation.
A potential solution I'm looking into now is changing the return URL of the initial order creation to redirect to a billing agreement approval URL and have the return URL's of that redirect back to the original return url.
Overly complicated and the worse UX I've ever seen.
Before I tear what's left of my hair out, does anyone have any suggestions?
UPDATE
Although it isn't the solution I was hoping for, I ended up removing the Shopware 6 PayPal plugin and implementing my own payment method using the NVP API.
From the user perspective, there is only one approval process. In the backend, once the user has approved the transaction (that has been marked as needing a billing agreement) the transaction is verified and then a recurring profile is created.
There's no way to combine Subscriptions and one-time payments in a single checkout. Such items even require different parameters on the PayPal SDK line, if using the PayPal buttons to show an in-context experience.
The in-context experience is best, since it involves no redirects away from your site to PayPal and back. Here is the flow for one-time payments:
Make two routes on your server, one for 'Create Order' and one for 'Capture Order', documented here. These routes should return only JSON data (no HTML or text). The latter one should (on success) store the payment details in your database before it does the return (particularly purchase_units[0].payments.captures[0].id, the PayPal transaction ID)
Pair those two routes with the following approval flow: https://developer.paypal.com/demo/checkout/#/pattern/server
A similar (separate) flow can be used for PayPal Subscriptions. Only one subscription can be approved at a time.

Custom PayPal Checkout for subscription plan

I want to build a custom PayPal checkout for a single product (subscription plan).
On successful purchase I need to save the current date +30 days to the user profile as well as upgrade the user role to "premium". This part is no problem but I'm having trouble finding how and what I need to use from PayPal.
Could someone point me in the right direction? Is the PayPal IPN service still a thing, or is it legacy?
I checked out some PayPal WordPress plugins but they offer too much esp. an own member solution or integration with WooCommerce, which I don't need. I only need a plugin that handles the checkout and gives me the chance to hook some custom actions on some events for example the successful purchase.
There's no reason to use something old like PayPal IPN. Use the current Subscriptions API, and webhooks for event notifications.
Subscriptions are documented here: https://developer.paypal.com/docs/subscriptions/integrate/
And to subscribe to webhooks for later event notification, see webhook event names for subscriptions.
The Webhook documentation mentions using REST SDKs. Those SDKs are deprecated, use HTTPS API calls.

Send email to customer when Subscription is Cancelled, Expired or Suspended

Using latest WooCommerce and WooCommerce Subscriptions and WooCommerce Membership plugins!
By default WooCommerce Subscription plugin sends emails about subscription cancellation, expiration and suspention just to admin, what is really strange. I think that customer should be informed about these actions. Therefore question - has anybody hooked it that such emails are also sent to customers?
Had not find any usefull solution so far for this issue...
to achieve what I want - decided to use this plugin: https://automatewoo.com/.

Woocommerce Subscriptions Stripe Automatic Recurring payments not working

I used woocommerce product to subscribe automatic recurring payment through stripe payment gateway in my site.I have used woocommerce,woocommerce subscription,woocommerce stripe gateway plugins for this process.
First payment for subscription is working fine,but automatic recurring payment is not working with stripe.
Here are the plugin links that i have used.
http://www.woothemes.com/products/woocommerce-subscriptions/
Can anyone provide solution for this issue?
Please do reach out to our support at WooThemes as we'd be happy to see what's happening here. Our official Subscriptions and Stripe extensions do work and have automatic recurring payments.
Here's a few things to check:
Be sure you have the latest version of WooCommerce, Stripe extension, and Subscriptions.
There may be a cron issue with your WordPress site. Try using WP Crontrol to find if there are any cron jobs that have been halted.
Find the scheduled payment that did not process and use the action scheduler to see if it was never fired. You can find this by navigating to /wp-admin/edit.php?post_type=scheduled-action. In the search box, enter {order_id}_ i.e. the ID of the order in which the subscription was purchased followed by an underscore. For example, for a subscription purchased in order 3125, the search string is 3125_.
We've also struggled with Stripe payments not automatically renewing (the initial payment goes through but not any of the renewal payments). We did try WooThemes support but they couldn't find the order as it was made by another web design company so we didn't have access to the order details. Also, you'll find the log's aren't very verbose.
The solution:
Go to: WP-ADMIN > WooCommerce > Settings > Payments > Click "Manage" next to Stripe > Click the box next to "Saved Cards". This needs to be enabled or it won't take payment.

Resources