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").
Related
We have a web site that already has GA page tracking and Goals set up to track conversion based on URLs, and these are working fine via GTM & GA.
We want to introduce a new product and track it via a separate goal/funnel.
Problem is the pages stay the same, so there isn't any change in the URL to differentiate when a customer has selected this product.
Our flow is as follows:
/Price
/Up-sell
/Summary
/Payment
/PaymentComplete
The customer selects the product on the Price page.
In order to get the Goals to track for this new product I've created a series of virtual page views that are triggered when the product is clicked and persist on subsequent pages.
So the URLs within GA now look like:
/Virtual/Price
/Virtual/Up-sell
/Virtual/Summary
/Virtual/Payment
/Virtual/PaymentComplete
I can see the page views within GA fine.
When I create a new goal I base it off the /Virtual/ urls.
However, because GA is firing on each page by default I effectively get two URLs in GA the original URL, e.g. /Price AND /Virtual/Price this then causes issues tracking between pages in the funnel & goal.
What am I doing wrong here?
How does everyone else manage this scenario?
You can add exceptions to the GA trigger in GTM, add the URLs that you don’t want. Or, don’t fire the trigger that sends the virtual page.
I am in a scenario where we are tagging up on part of the site (purchase.mysite.com) with GA tags but we aren't tagging up the main site (www.mysite.com).
The problem is that a lot of traffic that goes to purchase.mysite.com initially goes via www.mysite.com which means if a user lands on www.mysite.com with a marketing tracking code and then goes to purchase.mysite.com the tracking code will be lost and all traffic from this route will be considered referral.
Is there a way to still pass this marketing campaign code when the user hits purchase.mysite.com (other than adding GA code to the main site which we don't want to do)?
If not possible in GA, is there another technical solution like saving the tracking code in the cookie and then setting it when the user goes to purchase.mysite.com?
Any help would be greatly appreciated.
Thanks,
Frank
Frank,
Your final paragraph htis the nail on the head: save your campaign tracking data into your own cookie and then read this cookie when you're on a page with GA on it and manually set the campaign data. You only need to set it once and it will then propogate through for the whole session/user as per your requirements.
To set the campaign data manually, just use code such as this (ref: https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#campaignName)
ga('set', 'campaignName', 'My Campaign Name');
ga('set', 'campaignSource', 'anotherwebsite.com');
ga('set', 'campaignMedium', 'cpc');
ga('send', 'pageview');
notes
You must set at least Source & Medium for the data to register with GA
Medium has a fixed set of possible values as per this google doc: https://support.google.com/analytics/answer/1033173?hl=en
If I programmatically trigger a goal, event, or a ecommerce transaction on a certain page, does Google Analytics register a page view on the page? (which would show up under Behavior > All Pages for example)
With goals it's actually the other way round - a pageview might be defined as a destinantion goal, i.e. the pageview triggers the goal. However the goal is not a pageview by itself, especially since it only exists in the view configuration.
Events and transaction won't show up as pageviews, either - but then thinking in pageviews does not always make sense. It's much better to think of "interactions", people doing something with your page. So an event will not show up in the page content section of your report, but it is still an interaction that shows up in the behaviour/events report and may e.g. have influence on your bouncerate. PLus any interaction will count towards your hit quota (free version of GA is limited to 10mio user interactions per month).
Google Analytics will only trigger a pageview in the following two conditions:
A page view is registered whenever one of the pages on a traditional web site is visited. In other words, if a user takes an action that causes the browser to refresh, a pageview will be counted. Take note, this does not count for single-page (ajax) applications.
Additionally, a page view can be manually triggered by issuing ga('send', 'pageview'); using analytics.js. You can attach this code to nearly any sort of event (including ecommerce transactions).
A pageview will not be registered otherwise.
Read about analyics.js here.
Can anyone please help me clarify below queries?
Including GA code two times in a same page cause double visitor counts?
Using below/event code directly on the page, does it creates an events directly in the GA portal? Or first do we have to create 'Video' as event first in the GA portal and then call this so that it will map itself?
Ex: _gaq.push(['_trackEvent', 'Videos', 'Play', 'Gone With the Wind']);
In google chrome extensions, while publishing it will asks for the GA id, and we provide, and if we keep main GA code in the extension pages(popup.html) too, then does it count as twice?
1. Including GA code two times in a same page cause double visitor counts?
If it's the same code pointing to the same account# and you aren't doing anything inbetween like deleting cookies, then no, it will not cause double visitor count. However, it will cause double page view count.
Using below/event code directly on the page, does it creates an events directly in the GA portal? Or first do we have to create 'Video' as event first in the GA portal and then call this so that it will map itself? Ex: _gaq.push(['_trackEvent', 'Videos', 'Play', 'Gone With the Wind']);
Traditional GA does not require you to do anything special in the interface for this. You should see "Video" show up as a value in the Category dimension automatically.
In google chrome extensions, while publishing it will asks for the GA id, and we provide, and if we keep main GA code in the extension pages(popup.html) too, then does it count as twice?
I think you may be confusing your Google Developer Account ID with the Account# associated with your google analytics account, but if your extension outputs GA code and there is also GA code on the page and it points to the same account, then yes, it will count some things twice (see your first question).
To be clear, every time a _trackPageview is invoked, a page view will be tracked. So if you have multiple calls to that then it will count multiple times. If the visitor cookie isn't reset or broken, it will count as the same visit(or).
Please help me understand this. I have a client for whom we created a sweepstakes "mini site". Traffic was generated through banner ads, eBlasts, and newsletters. For the banner ads, I created custom urls, i.e. www.somewhere.com?utm_source=yahoo?utm_campaign=abc to track the traffic to the landing page per vendor/banner. this works just fine.
The entrant visits the page, signs up for the sweepstakes, has as double opt in email process for verification. All of my entering traffic to the landing page is tracking fine, and is properly broken down by utm_source and utm_campaign.
Some of the vendors had me place tracking pixels on the confirmation page for conversion statistics. The only info I have placed for internal tracking on the confirmation page is the GA tracking code.
I have been told to create tracking pixels to track the individual vendor conversions. Is this possible without the originating pixel data from the vendor? I am new to tracking pixels, but my understanding is that I need some information from the vendor in order to write the code for the pixel. Am I wrong?
I can't understand how we can place a tracking pixel on our end without at least campaign name or data from the vendor's tracking pixel that they placed on the page containing our banner ads.
What am I missing here? How can I actually separate the conversion traffic from the different sources when everyone receives the same double-opt-in email?
Please ask me to clarify if I am not being clear. Thanks in advance for reading my question.
There are two things you are trying to track here. One is Campaigns: Campaigns are how you measure the effectiveness of techniques to bring users to your site.
The other thing you are tracking is Events - this is what users are doing once they arrive at your site. If you want to track individual vendor conversions, you should add an onclick handler to either the submit button, or link that you are calling a "conversion"
For example:
Your link here
If you are adding the push to a form submit, you might want to have that push happen on the pageload of the success page, rather than the onClick of the submit (otherwise it will track the event, and it might not have actually happened due to form validation errors for example)