What I’d like to do…
Set up a Mautic server side tracking script, use it to send a virtual ‘payment complete’ pageview to Mautic. When this virtual pageview occurs, it updates the contacts ‘Stage’ to ‘Paid’ using a campaign.
Some background to my set up…
I have a site which sells products via Paypal. To track sales in analytics I do not use thank you page javascipt as it’s unreliable (about 20% of Paypal users don’t get returned), which leads to inaccurate tracking. Instead I have a server side php IPN listener script which tracks sales, the IPN url (along with a parameter of the users google analytics client id) is posted to paypal at checkout, then when the user pays, Paypal sends the script payment confirmation. At this point the script does two things, first it updates my orders payment database table with the customers payment status, it then uses a google server side analytics script which sends a virtual ‘payment complete’ page url directly to googles anaytics servers via payload. Importantly this is all done server side and not client side, i.e. google analytics tracking pixels are not and cannot be used.
This is what the server side google analytics code looks like…
At one time, I used a remarketing platform called cloudIQ. In order to track sales for this platform, within the same IPN listerner script I cloned the google analytics server side analytics code above and repurpose it for cloud IQ's tracking using the customers email as a unique identifier...
I created a campaign form in mautic which takes the same fields as my current checkout (First Name, Last Name, Email, Address Details). I then took the mautic action url and form field names from the subsequent form and implemented a ajax / php curl script which onsubmit posts my form data to mautic, before posting my usual form to paypal. This works fine. It creates a contact in mautic and posts checkout info to Paypal after. However once the user pays and paypal sends payment complete status to my IPN script, I want a virual 'payment complete' pageview to be sent to Mautic, so I can use a campaign to update the contacts 'Stage' to 'Paid'.
So my questions are...
Can I use an amended version of the above script to track a virtual 'payment complete' pageview in mautic? If so, what would that look like?
If this is not possible, what are alternative options to achieve the same end result (i.e. update the contacts stage to 'Paid' without relying on client side thank you page php / js pixel tracking?