Custom dimensions values passed over, but not available in google analytics - google-analytics

html code:
ga('send', 'pageview', {
'dimension1': '#useType',
'dimension2': '#artType'
});
The custom dimensions values are right in google tag assistant.
In google analytics, i added both the custom dimensions in admin settings page. But I couldn't see the passed over values in google analytics.
Am i missing any configuration?
Kindly help.

Related

Google Analytics Search Metrics

I need to implement google analytics search metrics. I have a ecommerce site. My requirement is that when i search for categories a list of products appears. Every product has like/ unlike button.
I need to track number of likes per search in google analytics.
Is this doable by google analytics ?
Please suggest!
You should use event tracking.
Events are user interactions with content that can be tracked
independently from a web page or a screen load. Downloads, mobile ad
clicks, gadgets, Flash elements, AJAX embedded elements, and video
plays are all examples of actions you might want to track as Events.
To fulfil your requirement, you could implement the event tracking as follows:
ga('send', 'event', [eventCategory], [eventAction], [eventLabel], [eventValue], [fieldsObject]);
// you may add this implementation, says when someone like a product:
ga('send', 'event', 'Products', 'like', 'Search Page');
// or when someone unlike a product
ga('send', 'event', 'Products', 'dislike', 'Search Page');
If you have unique URL and PageView Tracking for each search, you have done and can view the metrics on Events > Top Events, with second dimension Page, filtered by search page.
Otherwise, you should setup Site Search. Send the pageview tracking manually as follows:
analytics.js: ga('send', 'pageview', '/search_results.php?q=keyword');

Google Analytics page view tracking

I am using a shiny dashboard with about 20 pages and recently implemented Google Analytics to track page views. The number of pageviews in GA seems to be the same for all pages. I think that once the home page is hit, all other pages are getting hit as well.
I need help to solve this problem. My GA.js script contains the auto script generated while creating an account with GA and this script.
ga('send', 'pageview', {'title': 'Shiny Dashboard','page': '/#shiny-tab-dashboard'});
I have generated similar lines for all the pages with different 'title' and 'page'. Thanks for helping out.
Google analytics does not record hash parameters by default so you would have to a
change your tracking code
https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#allowAnchor
Below are the changes required
Replace
ga('create', 'UA-XXXXX-Y', 'auto');
with
ga('create', 'UA-XXXX-Y', {'cookieDomain':'auto','allowAnchor': false});

GTM eCommerce tracking

I would like to start tracking e-commerce with Google Analytics, to do this I need to pass the values of my data layer into GA using GTM. I have read endless amounts of documentation on the subject and as far as I can tell it should work, however I am still having problems.
The online store we use is actually a third party system (quote engine) so we can't change what is passed to the dataLayer, everything we need is passed to the dataLayer but I can't figure out how to send this data using GTM to GA.
My data layer looks something like this on the checkout page of the site:
dataLayer = [{
'u12': '18000011', 'u10': '31903296', 'u11': '159328761', 'u3': 'XXLX', 'u7': '58.97'
}];
The custom HTML tag in GTM I'm using is firing in the correct place but not sending the information to GA, the tag looks like this:
<script>
ga('require', 'ecommerce', 'ecommerce.js');
ga('ecommerce:addTransaction', {
id: '{{u12}}',
revenue: '{{u7}}'
});
ga('ecommerce:addItem', {
sku: '{{u12}}',
name: '{{u3}}',
price: '{{u7}}',
quantity: '1'
});
ga('ecommerce:send');
Unfortunately this is not working and my Google Analytics is empty in terms of e-commerce transactions, any help on this would be greatly appreciated.
Google pushes the enhanced ecommerce tracking thing. It is hard to find the old documentation of the standard ecommerce tracking.
GA Ecommerce Tracking with Google Tag manager
The solution was a combination of the two answers. I used Mindbreakers link as a template to create the custom data layer suggested by Eike Pierstorff and then used a standard transaction tag in GTM to send the information.
I would like to say a huge thanks to Eike Pierstorff and Mindbreaker for helping me with this.

I am trying to set value for custom dimension in google analytics for my website

I'm new to google analytics and i don't realize how make it works.
We have a website and we want to capture the customerId as custom variable in google analytics in order to analyze the behavior of each user with the site.
For this, i start to use google analytics (analytics.js) a few days ago and i created a custom dimension (to know who user access).
The dimension was created with session scope because those values must be sent once per session.
After that, i add the code needed as is explained here:
ga('create', 'UA-#######-1', 'domain.com');
ga('send', 'pageview', { 'dimension1': '<%Convert.ToString(Session["SelectedCustomerID"]);%>' });
I've tried this code and others configurations but google analytics doesn't take the values.
What i'm doing bad? Please suggest me a way to capture the information.

Google Analytics Custom Dimension Not Being Set

I've recently upgraded our site to use Universal Analytics and am trying to get some custom dimensions to work. However, no custom dimension data appears to be logged. Below is an example of my code.
ga('create', 'UA-XXXXX', 'test.com');
ga('send', 'pageview');
ga('set', 'dimension1', '149377');
Do I need to set custom dimensions before sending pageview?
A dimension is sent along with the either a page view or an event. It won't get sent by itself. So you should switch the order of the 'send' and 'set', then look in the network to see the page view call and you should see the dimension as one of the parameters.
Note that you will see the dimension data in google analytics with a delay of a day or so.
I had the same problem, took me a while to find out its cause...
That's correct by the way, that is you must do the SET before the SEND.
Here is the official documentation (see section "Collection"):
[...] Unlike other types of data, custom dimensions and metrics are sent to Google Analytics as parameters attached to other hits, like pageviews, events, or ecommerce transactions. As such, custom dimension or metric values need to be set before a tracking call is made in order for that value to be sent to Google Analytics.
For example, to set a custom dimension value, your code might look like this:
ga('create', 'UA-XXXX-Y', 'auto');
// Set value for custom dimension at index 1.
ga('set', 'dimension1', 'Level 1');
// Send the custom dimension value with a pageview hit.
ga('send', 'pageview');
Cfr. https://support.google.com/analytics/answer/2709828?hl=en

Resources