Extension, Fieldtype, Module

Archived
Forum
(read-only)


For official support, visit the official support site »

Entry Analytics

ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From mithra62

     

Wildcard URL segment pattern? Low Variables compatibility?

Feature Request

Andy Homan
Andy Homan

Hey guys,

Great addon! No idea if this is is even possible but is there any way you might be able to add something similar to a wildcard segment to the URI patterns?

Here’s my scenario… I have a site section where I’ve essentially replicated category-like functionality with Playa and related entries. The reason is that I need to have custom fields assigned the category pages which need to be navigable pages in their own right. That gives me the following setup:

Parent Channel
- Cat page 1
- Cat page 2

Sub Page Channel
- Page 1 (related to Parent channel [Cat page 2])
- Page 2 (related to Parent channel [Cat page 1])

The Parent Channel works fine with the following: /parent-channel/{url_title}

The sub-pages don’t: /parent-channel/{need_wildcard_here}/{url_title}

I may be dreaming but I imagine this would be an issue other are likely to encounter in future.

Now just to really test my luck, a lot of the content for landing pages on this site is handled with Low Variables. I know the addon is called “Entry Analytics” but it would be awesome if you could select the built in Field Type from within Low Variables. That way I’d have data for pretty much every aspect of the site!

Anyway, thanks again — great addon.

Andy.

Christopher Imrie & mithra62
# 1
Christopher Imrie & mithra62

Hi Andy,
Thanks for the kind words, glad you like the addon.

What you’re describing is something that Eric and I have been discussing internally for a little while. As you know, at the moment the URI patterns only accept text or variables to define a pattern. What we will eventually be looking to do is convert this to use Regex pattern matching. This has the side effect of being more complicated to setup and install the addon but it will allow for URIs like you describe, where you need to have a wild card segment.

We know about it and want to do it, but I cant give you a timescale on when it’ll be implemented.

As for the Low Variables, I think the setup you are describing is a selection of templates, each outputting a different Low Variable? As such what you’re looking for is more of a analytics summary by URI, since there is no entry right?

-C

Andy Homan
# 2
Andy Homan

Hey Chris,

Regex would be awesome! That would definitely solve my issue.

As for Low Variables, you’re right too there is no entry. Your suggestion sounds exactly like what I would need. Basically a field when you can enter a URI in the setup and it outputs the stats. That way I could simply have that field positioned at the top of my Low Variable group and it would be a consistent user experience for the client. Irrespective of whether they’re editing a LV “page” or an entry they can see the page stats at the top of the page.

Cheers.

a.

InoaTech
# 3
InoaTech

Re: Wildcard URLs, this was a feature I needed. I hacked /libraries/google_analytics_service/Google_analytics_service.php at line 262, replacing:

return ‘ga:pagePath==’.$url;

with

return ‘ga:pagePath=’.$url;

Now, if I want to return an exact url as before, I just add a “=” to the URL string. Otherwise I can just prefix with a “~” and I’m on my way.

Review the Filter Operators at https://developers.google.com/analytics/devguides/reporting/core/v3/reference#filters and the explorer at http://ga-dev-tools.appspot.com/explorer/

I have no idea if this affects the entries or control panel functionality, and I don’t really care—I’m not using that now.

Christopher, what do you think?

- John