Can I trigger google analytics events for a user from different environments? - google-analytics

We are trying to have a full view of user journeys through the web application we are developing. In the middle of the journey, there's no problem because it's more or less a traditional web application, but the beginnings and the end are not usual.
The journey begins with us sending email to the customers (don't worry, it's not spam). Is it possible to send events to Google Analytics about email being sent? I can include the UserID in those events. If I then implement user id in my web application, would I be able to correlate emails send to website visits?
At the other end of the journey, the conversions don't happen by the user that's being coverted but by a manager manually marking the user as converted in a sort-of admin-side to the web application. Can I then again inject the event that the user was converted with the appropriate UserID? Will Google Analytics then be able to map the whole journey? Do I need anything else?
The goal is for those events to end up mapped in the charts that look like this:

You'll need to do what you're asking in a CRM.
That said, I think what you CAN do is use campaign tracking and track the links in the email sent to the users. This way you'd know if they've acted on the emails or not.
Then you'd be able to track them on your site when they interact with the email. If there are CTAs on your site for the users to contact a manager to be converted, then you can track those as events, then set up goals around these events to see conversions.

Related

How to set up conversion tracking to optimize campaigns for approved user?

I'm trying to finish my analytics setup and I've got a bit confused what is the best way forward. The end goal is to have tracking setup that enables me to optimize my Google and Facebook campaigns towards approved users instead of just signed up users. Our product has the following funnel:
User visits our website
He signs up for our product using website lead form (at this moment I have user's email, name, phone number etc.)
Based on our evaluation (that can take hours or days) the user is approved or disapproved in our CRM
I want to provide the advertising systems (mainly Google Ads and Facebook Ads) with an information when the user was approved with all the required ids so the system can trace the event back to the ad the user clicked.
I have the following analytical stack that I am working with:
Website GTM container
Server GTM container (GA4+ UA clients, GA4 + UA + FCAPI tags)
Facebook Conversion API implemented in sGTM
What would be the best way in your opinion to implement the tracking of the event that is fired from our CRM when user is approved? I was thinking about using Measurement Protocol to send the event to sGTM/GA4 or Enhanced conversions for leads for Google Ads but neither solutions seems to fit 100 % to my scenario. What would you recommend? Thank you for any inputs.
GA4 Measurement Protocol or Google Ads API and Facebook Ads APIs are the right way to go.
You'll have to store click & user identifiers ad platforms use (fbclid, fbp, gclid/_ga etc) and then pass them to Google Ads (either through GA4 measurement protocol and GA4-GAds connection or directly to Google Ads API) and Facebook CAPI together with the conversion. There are services like Able CDP that do the entire process - recording ids, getting conversions from CRM, sending them to APIs.
Doing it with sGTM or something like Zapier alone would be significantly limited. They don't remember what click ids, IP address, browser etc the user had when signing up and only around half of the conversions without click/user ids recorded at a lead form submission and sent together with the conversion will be attributed typically (the ones for which ad platforms recognise the users' emails).

Setup Google Analytics Goals with user session properties

I’m trying to set up some dashboard to track the page views of my customers and identify how many of them visit the website logged in, how many visit the website and have a plan subscribed (SaaS company) and how many visit a specific page and have a plan subscribed.
Is there a way to implement this in Google Analytics?
If you send these informations to Google Analytics (i.e. an event when user is logged) you can create segments and get them number.
You can find here how to build a new segment: https://support.google.com/analytics/answer/3124493?hl=en

Tracking offline conversions with Google Analytics

On a website with affiliate links, where there is no programmatic access to the conversion logs, I treat it as offline conversions.
My Setup
Online
A user visit my website, see the affiliated ad and a promotion view hit is being sent.
When the user clicks the ad, a promotion click hit is being sent and the user is redirected to another page on my site.
On the "redirection page", an product view hit is being sent, and the user is being redirected to the affiliation link, passing his Google Analytics clientId.
Offline
Once a week I download the stats from the affiliate program, which looks something like:
clientId visits conversions revenue
4444444444.3333333333 1 0 $0
1234567890.1234567890 1 1 $16.40
Then I use the Measurement Protocol to send offline events:
For each line of visit, I send a product click hit.
For each line of conversion, I send a product purchase hit.
My Problem
The conversion shows up on the eCommerce report:
Because the offline hits are being sent after the original session is already closed, a new session is opened which doesn't contain the info about the user.
So I can't see the conversion on the demographic report, for example:
Optional Solution?
I'm thinking of using the user-id feature of Google Analytics.
Even though the users are not identified, I can identify them by their clientId.
Sure, this is not what Google intended when they introduced that feature, but I believe it will solve my issue. I'm just not sure about the negatives.
My Questions
Any feedback on my setup?
Why is it even necessary to pass the clientId after the session is closed? what kind of information is being shared between the real session and the offline hit?
Is it a bad idea to pass the clientId as a userId to Google Analytics? Why?
Relevant Articles
A Comprehensive Guide to Tracking Offline Interactions in Google Analytics using the Measurement Protocol
Google Universal Analytics isn’t Linking Offline and Online User Properly
We were able to link offline action through as you did with measurement protocol but the problem is that those sessions are not included in demographic and age report.
Rather looking those report I used them to do segmented analysis E.g. pages they have look at, sources they used to come also I used it with attribution model to understand best channels to drive more conversions.
Yes you can use CID as a user ID but I haven't tried it with offline tracking. Share the result with us.

Google analytics Embeded api with out Oauth authorize

How can i use gapi.analytics.auth.authorize without button..
I need it for customers, to track visits on their subdomain, and I have my analytics code on page, so they can't use button to authorize, need without it, automatically.
Any example?
Your question isn't very clear it is hard to understand what you mean by Button.
I think you mean that you would like to select data from YOUR Google Analytics account and display it on YOUR website.
To do this you will need to use a service account as apposed to Oauth2 (Oauth2 would popup with a new window requesting access). When you create the service account in the Google developer console take the service account email address. Give it access at the ACCOUNT level in the Google analytics admin section. It must be the account level this will then give the service account access to read your Google analytics data.
Quota: I am not sure what you are extending to do here but remember you can only make 10000 requests per day against your Google Analytics profile. After that you are cut off there is no way to extend this number. So I advice you to save the data in the database someplace you shouldn't request the same data more then once.
Example:
I suggest that you look for an example in what ever programing language you are intending to use. Again your question doesn't state anything about what language you will be using. Hello analytics API might be a good place to start but it depends upon the language the PHP one is way out of date I wouldn't bother with it. Also you cant use a service account with JavaScript so that one is out to.
Update figured out button
Embded api I think I have finally figured out what you mean by button. gapi.analytics.auth.authorize is used in the Google analytics embedded api. Which is JavaScript which it is not possible to use with a Service account. So the final answer to your question is
Answer: You cant remove the button from the Google Analytics Embded api the only way to login with JavaScript is to use Oauth2.
Advice: switch to PHP and use a service account to request data yourself. Or give each of your customers access to your Google analytics so they can login themselves.

How to share a part of the site in Google Analytics

we have events listing website and events from different organizers are grouped (by URL), like -
www.site.com/organizer/event1
www.site.com/organizer/event2
www.site.com/organizer/event3
etc. How to give an organizer an access only to his/her part of the site's Google Analytics?
Easy way -
An organizer registers in Google Analytics
An organizer creates a counter in Google Analytics
An organizer sets this counter in his/her profile on our website.
We add this counter to our Google Analytics code on www.site.com/organizer/* pages
He/she clicks on some link in the profile and sees the GA stat only for own events.
The way I want it:
He/she clicks on some link in the profile and sees the GA stat only for own events.
Is this possible with some API to separate statistics for www.site.com/organizer/* and share a private link to it with organizer?
After reading your comments in another answer (which is basically just a copy of the comment I left on your question). I have changed my recommendation left in comment, think you should use the Google Analytics API for this.
Since you want to give others access to your own data I suggest you use a service account. You will need to do this in a server sided programing language, say PHP or C#.
Every night run a job that will extract the data you want though the Core reporting API. Store it in the database then create a page that will then display only the data you want to the different people. You will only need to run your job once per day as the data for previous days will never change. Wait at least 24 hours to get the data as data hasn't completed processing for 24 hours.
I am not sure what language plan on using but these tutorials should get you started: Google Service Account with PHP or Google Analytics API Authentication with C#
I would create different profile views with filters to include only the subset of data for the subpages.
This way, you can add a specific user access rights to that specific profile only, so they can only view that profile when they log in.
Create an include only filter which filters on Request URI: /organizer/event1, /organizer/event2, /organizer/event3 etc.

Resources