Is there any way to query the google analytics data to look for ClientID and then extract source and medium information of that client?
The scenario is, to look each clientID for x period amount of time and retrieve related info of that client like source, medium especially organic and direct, then append it to a custom URL as a parameter to pass it long between different system.
Client X -> Google API -> Source/Medium -> Website -> (Custom page with custom URL parameter + GA-source-medium-parameter) -> Next system -> Billing -> CRM (Client X - organic or Client X - Direct etc).
Is it possible on GA universal and GA4?
Or it something can be setup using tag manager easily, by using cookie session or utm parameters?
PS - Not an API guy but did some decent research but couldn't locate the right info or examples.
There are no standard dimension Client_ID in both API UA (https://ga-dev-tools.web.app/dimensions-metrics-explorer/) and GA4 (https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema). You should create custom dimension at first and after data collecting it will be possible to query Client_ID and source/medium. But keep in mind that one Client_ID can have a few sources.
Yes you can for UA. The dimension is called ga:clientId. For GA4, it’s available in Bigquery and is called user_pseudo_id. If you want to query it in the ga4 api, you will need to pass it as a custom user property in gtm.
Related
I add analytics.js script on my website. Also, some visitors of my website come from adWords.
So, I have website visitor identificators:
ClientId from _ga cookie
GCLID time-to-time from query parameter
Does it possible retrieve "search keyword" and/or other data with Google APIs using this identificators?
No, or at least not by default in a standard account.
The client id is not exposed via the API or in the GUI, with the sole exception of the User Explorer Report (which is not exposed via the API). You could store the client id as custom dimension and use it to search for data. it would not give you organic keywords (for some time now organic keywords are mostly unavailable in GA), but conceivably paid keywords for a session.
The GCLID is resolved within GA to medium (cpc), source (Google) and campaign name (whatever you named your campaign within Adwords), but it is not directly accessible in GA, and it does not give your user level data.
If you are in a GA360 account you can export data to BigQuery, which gives you a more comprehensive dataset including the client id (but still no organic keywords).
Summary: Marketing channels on GA using 'cid' instead of 'utm' parameter in URL
We use Adobe Analytics and hence all traffic channels are configured with 'cid' parameter for all campaign tracking. For ex.
cid=ps:Tata_Cliq_Westside_Exact_Apparel:Google:Search_Sok_Tatacliqwestside_E:Apparel-Unisex
This parameter is taken by Adobe Analytics and processing rules then give the data under various channels.
How do I use the same setup and implement marketing channels on Google Analytics? I don't want to use utm as a query-string parameter.
You can use View Advanced Filters to rewrite campaign/source data from URL with the help of regexp but I suppose that it would be a very complicated filter and data will only be available in the view where the filter is applied.
If you're using Google Tag Manager you can set up custom javascript variables to extract data from URL and pass it along with Google Analytics tags as pre-set fields for source/campaign/medium etc.
I need to track E-Commerce data in my Google analytic account using measurement Protocol. In the request I need to send following data and those data need to be tracked in my account.
Billing City (utmtci)
Billing Region (utmtrg)
Billing Country (utmtco)
But when I tried to find the parameters for these using enter link description here I could not find any matching parameter. Please help if any one know whether I can track these using measurement protocol.
This has been discussed (but not yet answered) here - basically it seems those fields have been deprecated.
I do not see that spelled out in the documentation, but those field do not appear in the parameter reference, not in the API (via the query explorer) and not in the GA user interface. If stuff is not part of the documentation it's pretty safe to assume that it is not there.
You can create custom dimensions in your property settings and send the geo information there.
I want to capture Google Analytics User IDs into our company's SQL database WITH the following information: UTM_Source / UTM_Campaign / UTM_Keyword / Goal Completion.
I know some analytis services may be better equipped but I believe there is a way to hack this.
Thanks!
You could write User IDs to a custom dimension (session or user scope, as you need).
For each User ID and UTMs set you will see a number of Goal Completions.
Using Core Reporting API you can import these reports into your DB:
https://www.googleapis.com/analytics/v3/data/ga?ids=ga%3A89723405&start-date=yesterday&end-date=today&metrics=ga%3AgoalCompletionsAll&dimensions=ga%3Adimension1%2Cga%3Asource%2Cga%3Acampaign%2Cga%3Akeyword
I have a website that uses Google Universal analytics and need to integrate to a booking engine which uses the old version (ga.js).
They want us to the the utma, utmb ... values in the query string when we redirect to the booking engine but those cookies and their values no longer exist.
Is it even possible to integrate the two versions of the analytics engine so we can pass the source information to the booking engine?
Should we downgrade and use ga.js tracking javascript?
Downgrading is not actually possible, but you might run the old code in parallel (which really seems a bit hackish).
A proper solution might to
attribute an id to each of the visits and store it in GA
pass the id as url parameter to the booking page so they can store in their analytics
send them a weekly report that includes visit id and source/medium/campaign so they can match it with their data
Of course you can store campaign tags (if any) in a cookie and pass them to the booking site, or write a custom function that emulates the way Google computes source/medium. But you cannot get source information from UA since this info is now computed on the tracking server and not stored with the client.