Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

brycematheson's avatar

Google Ads Conversion Tracking with Spark

Is anyone familiar with how I might implement conversion tracking with Spark, as far as Google or Facebook ads go?

Typically, I configure my Ads to search for some type of URL, such as "/billing/payment/success", and simply count that as a successful conversion. The other alternative is to add some javascript within the tags on a specific page.

Is there any way to accomplish this with Spark? I'm using the latest version of Spark (not classic).

Thanks

0 likes
3 replies
andersb's avatar
andersb
Best Answer
Level 3

Option 1 - Google Tag Manager

It should be possible when using Google Tag Manager to check for the appearance of the confirmation message and trigger a conversion once that is seen. It has a few disadvantages:

  • Con: First of all it require Google Tag Manager
  • Con: It breaks when using translations (or you need to take ALL of those into account in Google Tag Manager)
  • Con: Unable to add the value parameter (price of your subscription)
  • Pro: Tracking occurs right away

Option 2 - Add session data

Listening for the event Spark\Events\SubscriptionCreated would make it possible to flash data to the session and once the user clicks back to your application then if the conversion data is present in the session then fire a conversion event using JS.

  • Pro: Pretty easy to setup and require little configuration
  • Pro: Can add the value parameter
  • Con: If the user does NOT click back to your main application then the conversion will not occur

Option 3 - Use server side tracking

I have not yet gone into details with this, but read more here: https://stape.io/blog/server-side-conversion-tracking-in-google-ads-adwords

andersb's avatar

Best option would probably to post a PR to Spark to emit custom events from the frontend like they already do in the backend. That way it would be super easy to track different events.

brycematheson's avatar

Thank you very much @andersb! I didn't even think about Tag Manager. I'll submit a PR to see if this can be added. In the meantime, this should get me across the finish line.

Please or to participate in this conversation.