Triggering Goals w/ One Conversion Page & Multiple Piwik Sites

I have multiple Piwik sites sending visitors to a single/common conversion page on another Piwik site. I would like to trigger a goal for only the Piwik site which has previously tracked the visitor. Is this possible? Is there a way to tell Piwik not to trigger a goal for a Piwik site if that visitor did not previously visit the site?

Currently I have the following tracking code installed on the conversion page. Obviously with this configuration a goal is triggered for Piwik sites 1 and 4 regardless of whether or not the visitor had been to these sites…


<!-- Piwik --> 
<script type="text/javascript">
 var pkBaseURL = (("https:" == document.location.protocol) ? "https://mysite.us/stats/" : "http://mysite.us/stats/");
 document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
 </script><script type="text/javascript">
 try {
 var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 4);
 piwikTracker.trackPageView();
 piwikTracker.enableLinkTracking();
  piwikTracker.trackGoal(1);
 } catch( err ) {}
 </script><noscript><p><img src="https://mysite.us/stats/piwik.php?idsite=4" style="border:0" alt="" /></p></noscript>
 <!-- End Piwik Tracking Code -->
 <!-- Piwik --> 
<script type="text/javascript">
 var pkBaseURL = (("https:" == document.location.protocol) ? "https://mysite.us/stats/" : "http://mysite.us/stats/");
 document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
 </script><script type="text/javascript">
 try {
 var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 1);
 piwikTracker.trackPageView();
 piwikTracker.enableLinkTracking();
 piwikTracker.trackGoal(2);
 } catch( err ) {}
 </script><noscript><p><img src="https://mysite.us/stats/piwik.php?idsite=1" style="border:0" alt="" /></p></noscript>
 <!-- End Piwik Tracking Code -->

Does anyone have an idea about this. It seems that many users would need this ability. I have a Google convertion tracking code on the same page but they only trigger a conversion if they sent the customer; it’s a fairly basic concept.
Thanks

Anyone?

I really need to solve this problem as I cannot obtain critial conversion data otherwise…

Sorry I don’t understand the question, can you try to phrase it differently or give an example>?

Matt…

I have an online education course. I have three websites serving as storefronts for the course. Each website gets traffic from different sources such as natural searches and PPC advertising. Each website has a ‘Start Now’ button with takes the student to a single registration/payment page. All three storefront websites funnel students to this same registration page. When the student buys the course they are sent to a page where I trigger a goal (only one conversion page for all three sites). The problem is, a goal is triggered for all three sites regardless of which site the studednt came from. So I end up with three conversions (one for each site that has a javascript tracking/goal trigger) when I really only had one. Is there a way to trigger the goal only on the Piwik site that previously ‘saw’ the student and sent them to the registration page?

In other words, instead of blindly triggering goals for every Piwik site on the conversion page, can Piwik isolate the refering Piwik site to credit goals for only that site. I do not want to trigger a goal on a Piwik site that has not tracked the visitor prior to the trigger. In this way I will be able to clearly see the conversion rate for each site even though they all funnel to the same conversion page.

Thanks so much

Please help me. I really need a solution for this problem.

So I end up with three conversions (one for each site that has a javascript tracking/goal trigger) when I really only had one.

I don’t really understand, you should only trigger the goal once not three times…

If you had PHP, I would add a parameters to the button which redirects the students to the ONE registration page.

Something like

website 1


<button...><a href="http://theregistrationpage.com/index.php?piwiksiteid=1">...</a></button>

website 2


<button...><a href="http://theregistrationpage.com/index.php?piwiksiteid=2">...</a></button>

website 3


<button...><a href="http://theregistrationpage.com/index.php?piwiksiteid=3">...</a></button>

Then, in the registration page, user the $_GET[‘piwiksiteid’] to set the id of the website you are tracking the goal for


<?php

$piwiksiteid = $_GET['piwiksiteid']; ?>

then from your code above
....
 try {
 var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", <?php echo $piwiksiteid; ?>); // here you output the id 
 piwikTracker.trackPageView();
 piwikTracker.enableLinkTracking();
  piwikTracker.trackGoal(1);
 } ....