Posts tagged with google-analytics-4

I have configured the Google ads conversions with GTM. Google ads conversions are high when compared to GA4. GA4 is linked to the Google ads account but was set as secondary. Primary conversion is configured with GTM. I know there will be bit discrepancies but I am facing a huge difference.

Google Ads configured via GTM and GA4 is linked with Google Ads. However, I am seeing higher conversions in Google ads for purchase and low conversion value in GA4 when I select source/ medium revenue.

So I am trying to send ga ecommerce events such as "add_to_cart" or "begin_checkout". Now, in the event objects, I am confused as to what price to mention in the items array of the event object. Do I mention the discounted price or the full price?

Allow me to elaborate with examples.

gtag("event", "purchase", {     transaction_id: "T_12345",     coupon: "socksSale",     value: 12.00, // value = quantity x sale price     currency: "USD", // The currency of the value, discount, and price     items: [      {       item_id: "SKU_12345",       item_name: "Socks",       discount: 2.00, // The discount per item       price: 4.00, // The sale price is the per item list price (6.00) minus discount (2.00)       quantity: 3 // The number of items sold     },     ] }); 

This example is taken directly from here: https://developers.google.com/analytics/devguides/collection/ga4/apply-discount?client_type=gtag

Now, in the above example, Google states that the price of the items must be the discounted price:

The sale price is the per item list price (6.00) minus discount (2.00)

Now, consider another example. (Again from Google)

gtag("event", "add_to_cart", {   currency: "USD",   value: 7.77,   items: [     {       item_id: "SKU_12345",       item_name: "Stan and Friends Tee",       affiliation: "Google Merchandise Store",       coupon: "SUMMER_FUN",       discount: 2.22,       index: 0,       item_brand: "Google",       item_category: "Apparel",       item_category2: "Adult",       item_category3: "Shirts",       item_category4: "Crew",       item_category5: "Short sleeve",       item_list_id: "related_products",       item_list_name: "Related Products",       item_variant: "green",       location_id: "ChIJIQBpAG2ahYAR_6128GcTUEo",       price: 9.99,       quantity: 1     }     ] }); 

This example is taken directly from here: https://developers.google.com/analytics/devguides/collection/ga4/reference/events?client_type=gtag#add_to_cart

Here, the item price is clearly not the discounted price as the event value is this price minus the item discount e.g. The full price.

The above examples show a clear contradiction in the guidelines.

I was able to find one relevant question on Stack Overflow here: What Discount property means in Google Analytics 4? . The only answer here states that item prices should be the full prices.

Now, I understand that one can send either of the 2 types of prices as they are the ones who have to interpret the reports afterwards. However, I am sending the data to Google Ads from Google Analytics as well. And, I do not want to report inaccurate data. So, what is the more standard/accepted method of reporting item prices?

I am using Firebase Analytics (which is built on top of GA4 from what I understood), along with Google Ads.

I have set up some events in GA4 as conversions, for example when a user signup, then I use these conversions to optimize my Google Ads campaign. This works well!

I now want to track not only signups, but also purchases. I could track them from the frontend, but it sounds dodgy to do that on the client side: what if the user blocks GA? what if a user maliciously triggers the event multiple times to mess with my campaign?

So instead I want to log the purchase events from the backend. However, it's very important that they're still properly tied to the originating ad click, so that Google Ads can properly optimize my campaign.

I am looking for some ID that I could send from my frontend to my backend to identify the user (and therefore the ad click). But I can't seem to find anything. What am I missing?

How do I report conversion from gtag on server side back to google ads?

My current setup is that I report events from gtag back to google analytics 4 using unique userId (generated in my database and it's unique for each user)

    let data = {         client_id: this.getDeviceId(),         user_id: this.userId,         events: [{             name: eventName,             params: props,         }]     }     ... then send it as payload to the tracking url to the ga4 tracking url:     https://www.google-analytics.com/mp/collect?measurement_id=...&api_secret=... 

Now I launched google ads and want to report purchase and renewals as conversion.

So I imported my target event from GA4 to google ads as an offline event.

But to my understanding, in order to properly link the user back to google ads, I also need to pass gclid in gtag when I report the event/conversion, but how to do that?

Should I just add gclid as property in data? Is it documented anywhere?

I was using the below doc link in order to setup gtag tracking on the server: https://developers.google.com/analytics/devguides/collection/protocol/ga4/user-properties?client_type=gtag

How to properly report conversions back to google ads when they happen on server side?

I guess my usecase is pretty common but I can't seem to find any relevant information:

  • user clicks an ad on google
  • they are redirected to my website
  • they signup for a free trial
  • I report the "sign up" event back to google analytics (GA4) using gtag
  • the sign up event is linked to google ads as an "offline" event

This works good so far.

Now when trial ends and the user is charged for the first time, I want to further report a "renewal" event with the "value" charged so google ads could further optimise. But how do I do this?

Renewal happens on the server, while I also track the renewal using GA4 api, I'm not sure how to link it to the original user so it can be attributed correctly in GA4 and then in google ads.

Seems like I need to get cookies that google ads create in browser to identify a user when the user first signs up, and then send the cookies to the server and to further pass them to GA4 every time the renewal happens. But I can't see any documentation on that neither.

So how do I report server side events back to GA4/google ads ensuring the even is attributed to the correct user?

As a note, I'm not looking to use Google Tag Manager.