-
Maximizing Conversion Tracking: Incorporating gclid with gtag and GA4 for Google Ads
I need a little help to send conversion reports from gtag on my server back to Google Ads. Currently, I’m reporting events from gtag back to Google Analytics 4 using a unique userId (that I generate in my database for each user). Here’s what my code looks like:
let data = { client_id: this.getDeviceId(), user_id: this.userId, events: [{ name: eventName, params: props, }] } ... I then use it as payload to the tracking URL of GA4: https://www.google-analytics.com/mp/collect?measurement_id=...&api_secret=...
After setting up Google Ads, I want to report purchases and renewals as conversions. So, I imported my target event from GA4 to Google Ads as an offline event.
Now, here’s where I’m stuck. As far as I understand, to properly link the user back to Google Ads, I need to include gclid in gtag when I report the event/conversion. But how should I go about doing that? Should I just add gclid as a property in my data object or is there a better way?
Oh, and by the way, I referred to this guide for setting up gtag tracking on the server: GA4 User Properties for gtag. Maybe there’s something in there that can help?
Log in to reply.