I have a set of tags on all of my article pages which I'd like to track. Ideally I want to see how many page visitors etc each tag gets. I want to be able to track pages that are tagged with beer and cheese and any other tags that it may find within the tag-group class.
<div class="tag-group">
<p>
beer
</p>
<p>
cheese
</p>
</div>
Is this possible with Google Analytics? And if so, how? I've tried pokeing around the interface but I haven't been able to find a way to setup some sort of specific tracking targetting.
I don't see a perfect way to do this because you cant store multiple layer on Google Analytics, so in almost all the cases you need to store all the tags in a single array. (You can unse a custom dimention isBeer for example, but this can be not the proper way)
But this 2 options might help you on this
Content grouping : this allows you to group the content by writer, editor, tags, etc. But in this case you have to manage to see how you group the content. i don't see much future in this way but here is an option
https://support.google.com/analytics/answer/2853423?hl=en
Use Custom Dimentions: This is the easiest one, you can add all the tags in a single string inside the custom dimention, and them look for it on the plataform segmenting or using it as a second dimention (on the report ).
https://support.google.com/analytics/answer/2709828?hl=en
the code on the pageview need to be modified to add this information:
ga('create', 'UA-XXXX-Y', 'auto');
ga('set', 'dimension1', 'Level 1');
ga('send', 'pageview');
This is more and less an option for you?
Related
I am trying to figure out how to add tracking with Google Analytics to multiple phone numbers on a Wordpress site. I saw this page from and earlier Stack Overflow post but I wasn't sure if it was up to date. I noticed somewhere else (here) on a Google search that said you have to add an Event in your GA account first and then add that code. Is this correct? Or do you just have to add the code itself to the Wordpress site without adding an Event in GA?
Also, if it's code for a link, can I highlight the phone number and put the code into the link area (as in chain link in the Visual Editor) on the page, or do I have to place this code in the Text Editor part of the page?
I'm using the current UA right now.
Also, I'm really new to this event tracking stuff, so please accept my apologies if I stated/asked anything incorrectly. Thanks in advance for any and all feedback.
Add a class to all your phone number instances within your HTML. ie class="tel">
Write a click function on that class, and then push the ga following the correct version syntax.
ga('send', 'event', 'category', 'action');
So:
$('.tel').click(function() {
ga('send', 'event', 'Category1', 'Action1', 'Demo!');
});
Use Google Tag Manager. It's great tool. There is also a plugin: DuracellTomi's Google Tag Manager for WordPress. You must read some documentation about GTM but when you will know GTM you can track almost anything on your site.
We have a total of six websites. Three for two countries consisting of (mobile, desktop and store). Individual tracking code was created for each but after speaking to our developers they put a different code across each site so that we could combine the total set of data of each site in one report.
We have been navigating the sites and placing test orders but nothing is being picked up in GA Dashboard. Not in Real Time either.
Do we need to add each unique tracking code to each site? If So how can these be combined to make one complete report.
Each site has it's own unique code (example)
/* Google Universal Analytics */
(function(i,s,o,g,r,a,m) {i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-XXXXXXXX-01', 'auto');
ga('require', 'ecommerce');
ga('send', 'pageview');
</script>
But our devs have added the same code to all sites. Example
ga('create', 'UA-XXXXXXXX-12', 'auto');
[Partial answer here, as you may need to provide more code samples of your ecommerce implementation if want help debugging that.]
With the same tracking code across all sites, you effectively have a rollup property. But you will need to add specific filters so that can differentiate the traffic from one site to the other, so add a hostname prepend filter at least so that you see which site traffic is from.
If you want to see site specific data with the rollup property, you will need to create individual views for each site, in addition to your best practice views (eg. Test and Raw). Each site-specific view should have an include filter that only shows permits data for that specific site.
If you want to include an individual property for each site, then you will need to give that tracking object a specific name ( Google 'named trackers'), but at least you wouldn't need to create separate views in your rollup property.
To check your hits, use a tool like GA Debugger for Chrome, or check your developer's network tab for the GA requests.
I am implementing Content Grouping on my Wordpress website using the tracking code method.
I understand from the official documentation that the tracking code should be inserted before a pageview, that is,
ga('set', 'contentGroup1', 'Blog')
alone won't fire but
ga('set', 'contentGroup1', 'Blog');
ga('send', 'pageview');
will. My question is:
Is there a way to send the grouping information without relying on a pageview?
I have tried sending an event rather than a pageview, but it didn't work.
I am asking because I am using a Wordpress plugin to inject the default GA tracking code, and I would like not to mess with it.
Thank you for your time!
Content groupings can be applied to events, and not just pageviews. When you send in an event hit, you can go to the Events > Pages reports to see if a particular page associated with an event falls into a specific content grouping.
One of the caveats is that the content groupings report under Site Content > All Pages report is different from the Events > Pages report. The former categorizes only pageviews, whereas the latter categorizes pages associated with an event.
Note that if you use the 'set' method to set the content group as you've done before the pageview hit, all subsequent hits for the page (events, pageviews, transactions, etc.) will be associated with the specified content group (ie. "Blog").
I want to send to Analytics all the tags associated to my blog posts, and see a report in Analytics with the performance of each post tagged with a specific tag.
I want to be able to send multiple tags for one single page.
I tried with custom dimensions, but I believe that I can't assign multiple values for each dimension in one shot.
Thanks
It´s possilbe to send custom dimensions (or metrics) as a string, this looks like this:
ga('set', {'dimension1': v1, 'dimension2': v2, 'dimension3': v3});
Okay... this might be a long winded question but I'm sure it's a major issue that most wordpress site owners want to know about.
I've upgraded to Universal Analytics.
What I want to be able to do now is track traffic to my site according to the author of each post, the category of each post, and the tags that each post is tagged with.
In other words - show me data for all posts tagged "foo". In wordpress, all this information is already readily visible in meta tags on each page.
There is something called "Custom Dimensions" that seems to be designed for this. When you create a custom dimension in GA it gives you some code that looks like this:
var dimensionValue = 'SOME_DIMENSION_VALUE';
ga('set', 'dimension1', dimensionValue);
So...
Question #1 - Where does this code go? Google doesn't say! Is it supposed to go inside my existing GA code snippit? if so where?
Question #2 - Lets say I'm trying to track Authors. I'm guessing the code should look something like this:
var Author = 'Mr. Foo';
ga('set', 'dimension1', Author);
So the question is - how do I populate "Mr. Foo" with the actual author of the page? How do I tell Google to ignore this if there is no author (like if it's the front page?)
Question #3 - What happens when I try to track something like category or tag and a post might have dozens of tags?
Any help to solving this greatly appreciated! I've been on this for 2 days and have not found a single tutorial that even comes close. I swear I'll write one if someone can help me get this done...
Question #1: Place the code just before you call the 'send' command, like this
var Author = 'Mr. Foo';
ga('set', 'dimension1', Author);
ga('send', 'pageview');
You can also embed the Custom dimension in the pageview call as a parameter like this:
ga('send', 'pageview', {'dimension1': Author});
Question #2: You would need to use JavaScript to get the author data, check if it was not blank, and then to assign that value to your author variable. Do you have the author defined somewhere on the page identified with a CSS class or ID?
Question #3: Can you elaborate on this question and show what some likely examples and scenarios are?
Note that when using Custom Dimensions, you only have a total of 20 to work with (unless you are on Premium, in which case you have 200), so you will need to use them wisely.