Tracking dynamic URLs

Hi! :slight_smile:

I have a question according tracking functionality of PIWIK.

I have a website where my URLs a dynamically generated (= no fix URL for each article). The URLs change in each session and for each user.

Is there any possibilty for PIWIK to recognize those different sites as one single page?

Or in other words: is there any possibility to track a website through its HTML title?

Thanks in advance for helping! :slight_smile:

Kind regards, Steffi

You could just use the same SITEID in the tracking code on each page?

Sorry you were mixing sites & pages :slight_smile: To get it to track as the same site use the SITEID, but not sure re to track urls as the same within a domain.

I meant pages… sorry about that… :wink:

My problem is I don’t understand how I can track those dynamic URLs in PIWIK because I have to provide the URL for each page for tracking.

For example: (the ID is dynamic)
http://blabla.aspx?ID=123456

Or do I only have to provide the first part: http://blabla.aspx ?

Sorry, I’m so confused right now… :confused:

Or is there a possibility to only provide the home page and further tracking is done automatically??

Thank you for your help!! :slight_smile:

The tracking code needs to be in the footer (or load) for each page. The SiteID i’m referring too is your Piwik SIteid which is created for each unique site added into the Piwik system.

This SITEID is added to the tracking code you generate/copy from within Piwik, which should load for each page in the domain.

Do you mean this line of code?

_paq.push([‘setSiteId’, 3]);

If I am tracking different pages, do all of them have the same SiteIDs?

Pages can be anything. Piwik requires a site url/website/domain name.

So if you are tracking www.google.com & your SITEID in Piwik for that domainname is 1 then every page you load (ie. www.google.com, www.google.com/blog, www.google.com/blog/titleofmyblogpost, Google Shopping) all gets logged as SITEID 1 if you have the tracking code in the footer or setup correctly it will load for any page beginning with ‘www.google.com’ or ‘google.com’.

If you are also tracking another website say ‘www.yahoo.com’ this needs to be setup as another site in Piwik with it’s own SITEID & it’s own tracking code.

You can however have CNAMES which are different for each url, but point to the same place - these will be tracked as soon as the javascript loads with the relevant siteid.

How can i manage to track all subsites as in your example: www.google.com/blog, www.google.com/blog/titleofmyblogpost, Google Shopping seperatly and moreover how can i do that, if I’m not exactly aware of how the name of the URL is going to be?

The first part of the domain name remains the same? As long as your .NET webserver adds the javascript code to each url it produces the tracking will be there for each individual page within the same SITEID. So not tracked as the same page, but tracked as part of ‘www.google.com’ for example.

Yes, the first part stays the same… :slight_smile:

Where can I look up, which subsite gets which amount of views if it has only one SITEID?

Thank you for helping me!! :wink:

You can either pull URL data via the API & import it into Excel then sort your urls.

Or just view them from the Action/Pages area in the UI.

Or I was going to say use Segmentation - which is what we do, but seems Piwik 2.4.0 's segmentation isn’t working!

Ok, thank you very much for your help!! :slight_smile:
I’m going to try this out… :wink:

You can use JavaScript to manipulate the page title that is tracked in Piwik. Use your server-side code to define a standardized page name for each request, and then set a JavaScript variable with that value.

See this documentation:

http://developer.piwik.org/api-reference/tracking-javascript#customize-the-page-name-displayed-in-piwik

Guys even I have a query…
I am working on an application which has 3 envs dev/stage/prod so based on this the siteid should change. how can i make this dynamic.