Skip to content
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

Allow goal tracking JS to be used anywhere in page (outside of Piwik script in footer) #10060

Closed
samtuke opened this issue Apr 15, 2016 · 1 comment
Labels
answered For when a question was asked and we referred to forum or answered it.

Comments

@samtuke
Copy link

samtuke commented Apr 15, 2016

Often goals need to be triggered in the page body in content that is dynamic when the site footer and header are the same. Currently it appears that trackGoal() only works when included in boilerplate Piwik JS code, usually in the page footer. Please generate tracking JS which can be used anywhere in the page, separate to any other piwik tracking code. This will also be necessary for sites with heavy use of dynamic JS content.

@sgiehl
Copy link
Member

sgiehl commented Apr 17, 2016

You can always call that method whenever you want. As long as var _paq = _paq || []; was already defined (which can also be done in before and outside the tracking code)

For detailed information about the JavaScript Tracking Client see http://developer.piwik.org/guides/tracking-javascript-guide

@sgiehl sgiehl closed this as completed Apr 17, 2016
@sgiehl sgiehl added the answered For when a question was asked and we referred to forum or answered it. label Apr 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it.
Projects
None yet
Development

No branches or pull requests

2 participants