How to track 2 domain names on same server


#1

Hi everyone,

I’ve a friend of mine who ask me to install Piwik on his websites.

I’ve never seen similar setup.
Each domain name has its own cpanel account

The two websites are on one Business Catalyst account with their own access:

http://site1.com/admin
http://site2.com/admin
But it’s the same console as if try to login in both at the same time you’re automatically lodged out from one account.

The 2 websites share the same home page with 1 link each to access it;s content

There’s one page at the root
http://site1.com

and the directories

  • index.html
  • dir site1
    • dir images
    • dir templates
    • home.html
    • contact.html
    • products.html
    • gallery.html
  • dir site 2
    • dir images
    • dir templates
    • home.html
    • contact.html
    • products.html
    • gallery.html

Even of its the same business owner, the two websites are targeting different market.

My question is:

How to effectively track the two website

Should I simply create one account in my Piwik install and track all the pages
or
should I have two separate accounts to track each entity

In this case the main issue is the shared home page!

I hope this special setup explanation is not confusing.

Any advice will be very much appreciated.

Also one more question, how to track the visitor by area or city and not only by country

Thanks a lot.

Marc


(Mark Clulow) #2

Could you track the homepage performance based on the exit pages (i.e. if the user went to site 1 or to site 2?)

Do you really need to track the root homepage?

Can you rename site 1 and site 2 homepages to index.html?

You seem to have explained the setup fairly clearly, I just can’t understand quite how it is possible!

I’m no Piwik Pro, so I hpe these questions help lead you to an answer.

Mark Clulow
Sales Director, Shenzhen Changhong Technology Co., Ltd.
http://www.changhonginternational.com


#3

Hi Mark,

Thanks for your answer.

Yes I could track the main Page and all the pages inner page.

I can't change the name of the name of the inner pages because of the business catalyst system

the first site when the its banner is clicked from the site1.com/index.aspx or site2..com/index.aspx has the following url: site1.com/site1/Home.htm and the other one site2.com/site/2/Home.htm

Each set of pages is based on a main template with place holders for the content of each page. The menu of each entity (site1 and site2) is driven by a module

I think I 'll first create 2 websites in Piwik, and place each tracking code in the footer of the two separate templates. But I don't know what code to put on the home page or if it's better to
Just create 1 website in Piwik and track the all thing from this one. This maybe should give all the detail of the tracking.

Thanks for your help.
Marc


#4

Ok I found a way to achieve this and I’ll share it here as other newbies like me might be interested.

As the website doesn’t support php, I changed the tracking code following the instructions in the FAQ.

I added the following line to the code:

I only used one site in the settings of the piwik dashboard

Now I get all the data, with the page tracking, and everything else.

Great tracking script, I love it.
Just need to master a bit more all the functionalities.

Marc


#5

It seems a little complex to me, but I will also have a try


#6

Thanks for Info !!! I spend a long time to trying get this to work :wink:


#7

If I understood that description correct then the pages are operated under separate domain names., including the ‘shared’ home page. So there is a clear distinction between the two usages of that page.

I have no experience with the rest of the setup. But maybe this is an option:
If you have access to the servers setup then you could solve the inclusion of the tracking snippets in an automatic way depending on the domain requested. This way you do not only get a reliable distinction between the two usages of that page, you also save quite a lot of hassles because you don’t have to integrate the tracking snippets into the pages templates.
Here is a description of the setup, maybe it helps:

http://blog.christian-reiner.info/2013/01/23/piwik/

arkascha


#8

in one point there mus be a diferentation from one domain to the other…

i asume you are using some type of programing language (hat does catalyst use??? action script???) inside index.html, and deppending on the domainname of the request you get one content or the other… (this shoud be the work of a webserver and not of an app)

if this is the case:
you could add some kind of : if (domain 1) {add this tracking script} else {add that tracking script}


(barton hammonds) #9

I was also searching for the same thanks for your post .I hope It would be helpfull for me.