Posts tagged with google-analytics

I'm facing a problem with custom events sent to Google Analytics. The main problem is that custom sent events are being assigned only to user acquisition and not to traffic acquisition.

I'm sending 2 custom events.

1st event starts the session:

{     "client_id": "435384.2118427612",     "events": [         {             "name": "session_start_test",             "params": {                 "session_id": 1733217977,                 "source": "Test source",                 "medium": "cpc",                 "session_number": 1             },             "timestamp_micros": 1733217976999990         }     ] } 

2nd event send source data:

{     "client_id": "435384.2118427612",     "events": [         {             "name": "custom_event_test",             "params": {                 "session_id": 1733217977,                 "engagement_time_msec": 100,                 "title": "Test title",                 "country": "Estonia",                 "source": "Test source",                 "medium": "cpc",                 "campaign": "test",                 "campaign_source": "Test source",                 "campaign_medium": "cpc",                 "session_number": 2             },             "timestamp_micros": 1733217977000000         }     ],     "user_properties": {         "country": {             "value": "Estonia"         }     } } 

Both events are sent to GA and can be seen inside realtime reporting.

The problem that both of these events still assign source/medium to user acquisition instead of traffic acquisition. I've also tried to send utm_source and utm_medium, but that did not work out. Any ideas where is the problem?

I'm sending both events with PHP curl, using Google Measurement Protocol API.

tl;dr: Should there be a sha256_ prefix to city, regon, postal code, country, and should I hash them or not?

---- details I am wondering wether google doesn't consider city, region and postal code a sensitive information or the docs are incomplete. Judging by the second example, I don't need to hash even street address. And yet I believe I should hash everything... [Using smarty in the examples]

                gtag('set', 'user_data', {                     "sha256_email_address": "{hash('sha256', $order_info.email)}",                     "address": {                         "sha256_first_name": "{hash('sha256', $order_info.firstname)}",                         "sha256_last_name": "{hash('sha256', $lastname)}",                         "sha256_street": "{hash('sha256', $address)}",                         "sha256_city":"{hash('sha256', $city)}",                         "sha256_region":"{hash('sha256', $country)}",                         "sha256_postal_code": "{hash('sha256', $zipcode)}",                         "sha256_country": "{hash('sha256', $country)}"                     }                 }); 

**Resources: ** https://support.google.com/analytics/answer/14171598 https://developers.google.com/analytics/devguides/collection/ga4/uid-data

"sha256_city":"{hash('sha256', $city)}", vs "city":"{hash('sha256', $city)}", vs "city":"{$city}",

I'm currently working on passing the User ID to Google Ads using Google Tag Manager (GTM). I've successfully configured the data layer to pass the User ID, and I can see this working correctly in GTM's preview mode, as shown in the screenshot below:

https://imgur.com/7lEkFcO

However, the User ID does not appear to be pushed into Google Ads. I've followed the steps to configure the Google Ads tag to capture the User ID, but it seems like something is missing or incorrectly set. Here are the steps I've taken so far:

  1. Configured the data layer to include the User ID.
  2. Verified in GTM preview mode that the User ID is being passed correctly.
  3. Set up the Google Ads tag to include the User ID variable. https://imgur.com/FU4kjxb
  4. I have setup google tag to pass user_id into google Analytics: https://imgur.com/uk3lnW4
  5. I have checked in the debug mode in google analyrics to see if i can find the User ID. But i cant.
  6. List item

Despite these steps, the User ID is not showing up in Google Ads.

What could be the possible reasons for this issue?

  1. Could there be an issue in when i am triggering the tags?
  2. Are there any specific debugging steps i can follow?

Feel free to modify the question to better suit your specific situation or any additional details you might want to include.

I'm encountering an issue with Google Ads where the square logo I uploaded doesn't fill the circular space on the platform. Despite uploading a square logo as per the requirements, it appears smaller within a circular frame on Google Ads.

Here are the steps I've taken so far:

  • Uploaded a square logo (e.g., 512x512 pixels) through the Google Ads interface.
  • Checked the preview, and the logo appears smaller and doesn't fill the circular space properly.
  • Verified the dimensions and file format (PNG or JPEG) are correct according to Google Ads guidelines.

Is there a specific format or setting I'm missing to ensure that my square logo appears correctly within the circular frame on Google Ads? Any insights or suggestions on how to resolve this issue would be greatly appreciated.

I want to add Google Analytics and Google Adsense to my website in NextJS. I found this official doc: https://nextjs.org/docs/app/building-your-application/optimizing/third-party-libraries#google-tag-manager

According to this, its enough to add:

 <GoogleTagManager gtmId="GTM-XYZ" /> 

However, I have problem with understanding how Google adsense works. I know that google adsense require from me to include another script to my head (my account is not approved yet for google ads). The problem is that I want to let user decide whether he accepts analytics and advertisement cookies. I was going to simply remove GoogleTagManager from my head for analytics but what with advertsiement? I.e. I can't remove the Google Ads script because I dont want to remove ads at all so have can I distinguish between "personalized adverts" (user accepted cookies) and "not personalized" adverts? How should I construct my code to handle all cases?