Google Analytics Goals

Permalink 1 user found helpful
I've been loving Tony's Traffic & Stats Package, which works beautifully with c5 (thanks Tony!). However, I'm also trying to work with Google Analytics to integrate with Adwords, and especially track Goals/Conversions.

So far, I haven't been able to get GA to track goals at all. After reading Tony's description for his package, I imagine it has something to do with how c5 internally handles URLs and serves a file. I'm using "Pretty URLs" in my c5 installation, with a bit of my own mod_rewrite too. I'm guessing that GA is getting lost somewhere in all of this.

For instance, I have a signup page where users can subscribe to a mailing list. So, my goal is set to track visits to /signup/-/set_password, since that's the last page in the signup process. But it's not tracking any visits since I set it up several days ago (and there have been some). It doesn't track visits to other pages in my funnel either, such as /signup/-/validate.

Does anyone have any advice on getting Google Analytics Goals to play nice with concrete5? Do I have to give Google the URLs in the ?cID=123 form?

Benji
 
ideasponge replied on at Permalink Reply
ideasponge
have you verified that your tracking code is being sent on those pages? Maybe your view.php file is missing the Loader::element('footer_required');

Other that it should be working. GA just looks at the URL but I have noticed GA also misses goal and funnel hits on other sites not powered by c5.

Check your Funnel paths as well. Perhaps you have a required step that isn't actually being hit so it invalidates the goal and never counts it.
Benji replied on at Permalink Best Answer Reply
Benji
I forgot that my mod_rewrite code was still doing redirects on this site [R=301], which is the only way I could get it to work. So, I just needed to add /index.php to the front of the URL in Analytics and now it works.

Thanks for your thoughts.
malkau replied on at Permalink Reply
malkau
Hi Benji

I am having the same issue with setting up Google Analytics Goals within Concrete5, and just wanted to check your solution....

What path are you using for the Goal URL?

I was using:

Match Type: Head Match
Goal URL: /enquiry-thanks

Do I need to change this to:

Goal URL: /index.php?CID=1234

or

Goal URL: /enquiry-thanks/index.php

??

I'm going to go with the former for now... but look forward to your response.

Thanks!
Benji replied on at Permalink Reply
Benji
Hi there,

The simplest way to answer your question is to say that "what you see is what it tracks". That is to say that, when you load the page, the URL that you see in your browser address bar is the URL that Google Analytics will count a visit to. If you think about it, it makes sense, because the GA code is a javascript snippet that loads on the page, and therefore knows nothing about what's going on behind the scenes in PHP or Apache. The GA snippet simply knows that it's on the page located at the address that appears in the browser, and therefore communicates to Google that a visit has been made.

So the first thing to ask is, do you have "Pretty URLs" turned on? I'm assuming you do since you said you were having the same issue as me. So if you do, and everything appears to be in order, i.e. when you visit the page at /enquiry-thanks, the page loads without anything changing in the address bar, then you would enter the Goal into GA exactly as you did initially -- Head Match, /enquiry-thanks. Apache is internally connecting you to /index.php/enquiry-thanks, but the GA snippet never knows that.

If you are not using Pretty URLs, then you are probably linking to the page as /index.php/enquiry-thanks in the first place, and so you would use that whole thing as the Goal URL in Analytics.

Also, if you are trying to use Pretty URLs, but your server is whacked out and you're having to use full redirects [R=301] in your mod_rewrite code, as I was, then you would have to use the final URL that appears in the browser as your Goal URL (probably /index.php/enquiry-thanks). The principle here again is "what you see is what it tracks". If you have any redirects, whether it's PHP or Apache making them, all of that happens before the page loads, and therefore before the GA snippet loads. The page that gets tracked is the one that's in the address bar when the GA javascript executes, so that's the address you need to enter as your Goal URL.

One gotcha to look out for with concrete5 is to make sure that all your links to the /enquiry-thanks page are indeed in the canonical format, and not in the query string cID=123 format. As you're probably aware, c5 has editing features, for instance in the content block, that allow you to insert a link to another page, but the link that gets inserted is in the cID format. So beware that you don't use those and end up with a mix of links to the same page, but different URLs, one of which Google tracks and the other it doesn't.

By the same principle, if you've aliased your goal page with your own custom mod_rewrite code, then you would probably need to undo that and change any links so that they're all the same.

Aside from all of this URL business, have you checked that javascript didn't get broken on the page before the GA snippet executed? Are there any other symptoms that you're experiencing besides Analytics just not tracking anything?

So, I hope I've shed some light on a solution for you. If you're still having trouble, or if none of this makes sense to you, then post a reply.

Good luck!