New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add javascript API to trigger a goal trackGoal #778
Comments
I think this will do well for Goals initially to get a basic functionality that lets us compete with and give my clients good advice on moving away from other platforms. How do you imagine the customVars being handled (is that to say add in different options of the sale much like I showed you would we could track inside skype?) I assume from looking at the referrer functions that the goals etc will also track to Search engines & keywords, direct traffic etc etc. being that it will also now be in the tracker means it can also be used on dynamic url's etc right, not limited to finding a url for goal conversion. Cheers |
Keeping it simple, given the flexibility of customVars, I don't think we need separate customRevenue and customVars parameters. Thus, the request from the client resembles those recorded for outlinks and downloads:
|
I tend to agree. Doing what you mentiong there Vip, would then let something like this data be tracked also? First Name Assuming I could get all that data in a sale process (which I do post through)? Talk Soon |
of course the only extra thing to say on that is.... so long as within customVars you can set the normal revenue that the current goal tracking uses (so that it can use the revenue as it would normally in the system. Marc |
The idea here is that if you omit the custom revenue in customVars, Piwik should fallback to using the revenue configured for that goal. Example JavaScript:
This is JSON stringified to:
Note: the custom data isn't being logged yet. |
Yep understood. So.... :D ETA on logging of revenue at tracker level :D One very excited tester eh |
I agree that we could put the revenue in the customVars, but because revenue is the only "custom var" that is built-in the plugin - and will always be - I thought it would be clearer / easier to put it in the function signature. It would be optional though. For consistency we could rename it actually:``` piwikTracker.trackGoal( idGoal, [customRevenue], [customVars]);
|
(In [1206]) refs #778 - implement trackGoal() on client-side |
Ok.
|
Hey Vipsoft, Is this ready to be tested out now? Talk Soon |
(In [1214]) refs #778 adding the new Javascript Tracking API function: trackGoal to manually trigger a goal. This can be used on external websites, simply give them the Piwik JS tracking tag, remove trackPageView and enableLinkTracking, and add the trackGoal call. Marc, please let us know if you need more details to write the tutorial/documentation. |
you can download piwik with this function at http://builds.piwik.org/piwik-0.4rc1.zip |
(In [1216]) refs #778 - fix broken unit test and de-lint |
the author of a book about Joomla and Virtuemart (ecommerce for Joomla) contacted us, and let us know that she would like to have a chapter about Piwik in the book, as well as documentation on how to track ecommerce using the goal tracking plugin, and the newly created trackGoal method - let's keep this in mind. Marc, a simple ecommerce example would be great to have in the documentation use cases :-) |
Appears that in the changes done in rc1 the old tracker code being generated has been put in place (under show code for the sites) Intentional? Also when would they need that chapter in mind? Also. Would it be possible to log both the original referrer that had the goal converted, and also the last one (I know you can set it in the settings file to be one or the other, but how about an option for both?) Marc |
Unable to get the goal to track currently you can see live example of code on the site ID & goal ID are correct. Unsure how to make this track as you must also set a tracking url when setting the goal up (no option yet to say use in code tracking only, would be good to add that). Would this be throwing it off? Will try catch up with someone in the morning and give it another shot. Thanks |
Marc, shame on me, my link the release was wrong (I pointed to 0.4rc1 instead of 0.4.1-rc1)... here is the right link: http://builds.piwik.org/piwik-0.4.1-rc1.zip sorry for the inconvenience, let me know how it goes! |
From initial checks its looking good on one domain. Will roll it out over some more tomorrow. though strange thing happened the updates Matt have stopped SearchEnginePosition plugin working. Marc |
seems to work fine - updated the doc on http://piwik.org/docs/javascript-tracking/ |
This is the highest priority task to make Goal Tracking really useful; I was thinking of:```
piwikTracker.recordGoal( idGoal, customRevenue, customVars );
The text was updated successfully, but these errors were encountered: