Download & Extend

Exclude hits when a specific arg string is present

Project:Google Analytics
Version:6.x-2.2
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

I have a pre-caching module [1] that hits a handful of pages on my site every time cron is run - that's 4 times an hour. It would be nice if I could append ?excludegoogleanalytics or some unique string on the end of the URL when pre-caching the pages so that Google Analytics would not load for that page. It would work much like excluding paths in the Page Specific Tracking Settings, but it would allow exclusion on arg strings.

I'm sure that the module could support this as-is if I spent more time with the "Add if the following PHP code returns TRUE (PHP-mode, experts only)." option? Is that the way to go, or is the arg string exclusion feature something you want to build in?

1. http://capellic.com/blog/pre-caching-low-volume-website

Comments

#1

Status:active» fixed

You are able to exclude IPs or URLs in the Google Analytics account at google.com... search for exclude IP or URL or by regex or similar.

Aside cron is not able to execute JavaScript and therefore such hits cannot be logged in GA. Do you really have this hits in your statistics? I guess *no*.

#2

Yes, you are right, this can be configured in Google Analytics. I'm just thinking of the day when my client's hosting provider moves their account to another machine and the IP addresses changes. It's just one more thing for them to remember. Alas, I understand that this sort of thing can be considered way out of the scope.

But, to your point about cron not being counted. Yes, you are right, but that's not what I'm talking about.

I have a pre-caching module that hits a handful of pages on my site every time cron is run.

Let me clarify that by saying that the pre-caching module is hitting these pages over HTTP by using the drupal_http_request() function.

#3

Let me clarify that by saying that the pre-caching module is hitting these pages over HTTP by using the drupal_http_request() function.

That doesn't matter at all. drupal_http_request() does not execute the page content. It only requests for the page and does nothing with the page text that comes back. There is no javascript executed anywhere and ga only works with JS.

#4

@hass: Thanks for the explanation. Makes perfect sense now.

#5

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here