How do I access the shared google analytics id in Drupal 7 - google-analytics

I am looking to use the Drupal Google analyics tracking Id in another part of Drupal to do some custom tracking.
I want to use the shared ga uA code that has been entered by the user and not create a new one.
How do I get a programmatic reference to the GA id that the user has already entered into the GA module.

Try this:
$ga_id = variable_get('googleanalytics_account');

Related

Google Tag Manager referral hostname

I have 2 hotel websites on their own domains with individual GA tracking codes which both use the same booking engine, also on a standalone domain. The booking engine can only use 1 GTM container, so both hotel websites also have to use the same GTM container with the aim to track the ecommerce.
I've used a page view tag with a hostname lookup variable which pushes the correct GA tracking code on each website which works fine. Problem is tracking the ecommerce.
I've tried using a URL fragment so if they are on www.bookingengine.com/hotel1 then it would assign the correct GA tracking code, but that doesn't work.
What I need is the tag manager to know the referral hostname if you are on the booking engine and change the GA tracking code used dynamically, so it matches the correct referral website. Is this possible?
You can get the Referrel-Hostname by using the Browser-API document.referrer. This gives you the Page the User came from.
Take this as an Javascript Variable and build a Trigger based on the Variable:
{{referrer}} regexp abc.com

Tie Google Analytics to Marketo Cross Domain Sub Domain Tracking API?

We are currently using Marketo for our landing pages but it is not the same domain as our company site. We are also using Google Analytics.
We have used this guide to tie our Analytics session to our anonymous or known Marketo record by inserting the Marketo User ID as a Google Analytics User ID and added the Marketo User ID dimension & set the scope as User.
Per this article, if we would like to have our Lead ID be recognized on non-Marketo landing pages, like our Corporate website, that we will need to do some extra API connections. Has anyone done this with success? I found that there is some Cross Domain Sub-Domain Tracking located here.
Would I only need to tie the visit to our corporate site to the Marketo Sub-Domain site visit as stated in the link above, which would then be tied to the MarketoID dimension that we just made shown in the first link provided?
Not sure what to do to make this happen or if it is as simple as doing the cross domain sub-domain tracking.
Apologies if I am not making any sense.
Thank you so much!
I'm not sure I understand your question entirely.
Are you trying to link/merge a known Marketo record on one domain to an anonymous Marketo record on another domain, and then pass that single Marketo record ID to Google Analytics?
This would involve matching the Munchkin cookies on both domains to Marketo records, probably via the REST API, then merging the two records.
Once you have merged the records from the two domains, you could pass this single Marketo ID to Google Analytics, using the same ID for both domains.
Resources:
http://developers.marketo.com/javascript-api/lead-tracking/api-reference/#munchkin_associatelead
http://developers.marketo.com/blog/get-a-visitors-cookie-id-and-then-query-associated-lead-data/
You can develop a javascript that capture the GA ID and MKTO cookie and store them in a databased. Then, sync the database with mkto and append the GA ID to the lead record.
We've developed a tool that does that automatically, without any coding and allows you to track leads/visitors cross devices and domains.
Check it out: https://gapidu.com/

Company domain google site visitors by name via google analytics

I have a company domain google site and enabled google analytics account. Could somebody advice if it is possible to view same domain site visitors by name?
I want to track who of my colleagues visited my site and what is the frequency.
Thanks.
In order to connect a user in Google Analytics to a person, you'd need some sort of system to make the connection. This could be a login, a form, a url parameter, or something like that, where at a certain point you know who they actually are. At that point, you can assign them an ID (in a custom dimension) and make reports tracking their behavior.
It is worth noting (as above) that you can't store personal info in Google Analytics - so the ID would have to be non-identifying, like a GUID or random, numerical ID.
Some strategies for connecting website users to individuals include:
Email Marketing - Many email marketing companies allow you to pass a unique identifier in the URL of anything they click. You could then read this url parameter with javascript and assign it to a custom dimension in Google Analytics.
Login/SignUp - You might have some content behind a login-wall. For example, in order to download a document, you make the user fill out some personal information (like an email and their name), then email a link to the document to them. Once you have the user's information in your system (via the form submission), you can grab the user's ID from the submission.
Manual Parameter - Similar to the "Email" one, you could just email your colleagues a link to the website with a custom ID on each link. Just read that parameter from the URL with javascript and assign it to a custom dimension.

Track user activity using google Analytics

I am new to Google Analytics.
We would like the analysis of our data data to focus on specific brand promotion, in my application I have the data from twitter, facebook and instagram. I would like to track user activity and collect data on click event such as
Title of the post
date of the post
channel(twitter,facebook,instagram)
etc.
I want to use an application unique user id and analyze the data based on a specific userid.
I have read custom Variables in Google Analytics, but I am not sure about how much analytics will help me to tracked above information.
From the Google Analytics Terms of Service:
Privacy.
You will not (and will not allow any third party to) use the Service
to track, collect or upload any data that personally identifies an
individual (such as a name, email address or billing information), or
other data which can be reasonably linked to such information by
Google. You will have and abide by an appropriate Privacy Policy and
will comply with all applicable laws, policies, and regulations
relating to the collection of information from Visitors.
That being said if your website has a Userid that can not be used to directly map back to a user. You could place that user id into a custom dimension.
You need only configure it in your Google analytics account then add a tracking code like this to your site
ga('set', 'dimension1', 'XXXXXXXX');
Then you will be able to use user id as a secondary dimension in most of the Reports on the website.

how to configure google analytics module in dotnetnuke

How can we configure google analytics module in dotnetnuke
Just I saw this link.
https://support.powerdnn.com/kb/a1780/how-to-configure-google-analytics-module-in-dotnetnuke_.aspx.
But whats this account id mentioned here as Tracking ID that we need to enter ?
-Rigin
It corresponds to your Google Analytics account number. It is something like 'UA-XXXXXX-XX'.

Resources