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

Piwik not running in Phonegap Apps #8341

Closed
mayurr87 opened this issue Jul 13, 2015 · 6 comments
Closed

Piwik not running in Phonegap Apps #8341

mayurr87 opened this issue Jul 13, 2015 · 6 comments
Labels
answered For when a question was asked and we referred to forum or answered it.

Comments

@mayurr87
Copy link

I am using piwik to find analyse on website have got the js code from setting option of the piwik.

                    <!-- Piwik -->

script type
var _paq = _paq || [];
_paq.push(["setDocumentTitle", document.domain + "/" + document.title]);
paq.push(["setCookieDomain", ".techforum-worldline.rhcloud.com"]);
paq.push(["setDomains", [".techforum-worldline.rhcloud.com"]]);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
_paq.push(['appendToTrackingUrl', 'bots=1']);
(function() {
var u="//piwik-techforumatos.rhcloud.com/";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', 1]);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
})();

Have pasted above code just above tag.

Above code working properly and on dashboard of the piwik getting stats also but same thing via cordavo android apk it's not working. Site is working properly on mobile via apk but call to the piwik not going.

What's wrong there? JavaScript is enabled. Is there a known problem.

Inside config.xml:

access origin="*"

already in place.

@tsteur
Copy link
Member

tsteur commented Jul 13, 2015

Just a guess, maybe instead of var u="//piwik-techforumatos.rhcloud.com/"; try var u="http://piwik-techforumatos.rhcloud.com/"; or https://...

@tsteur
Copy link
Member

tsteur commented Jul 13, 2015

If it doesn't work, it would be great if you could remote debug your PhoneGap app and let us know if there are any errors

@mayurr87
Copy link
Author

Bravooo!!!!......Thanks a lot...

var u="http://piwik-techforumatos.rhcloud.com/"; works for me...

Searched a lot for this and final you helped. hope on next version piwik site will give the proper js code. because its very difficult to debug third party lib.

@mattab
Copy link
Member

mattab commented Jul 14, 2015

@tsteur do you reckon we should do something to prevent such issues in the future (product improvement, or otherwise a FAQ maybe?)

@mattab mattab added the answered For when a question was asked and we referred to forum or answered it. label Jul 14, 2015
@tsteur
Copy link
Member

tsteur commented Jul 14, 2015

Was thinking about this as well. Not sure what best solution would be. If we had a type "PhoneGap App" (similar to type Mobile App or Intranet) then we could generate the tracking code differently based on that but it will maybe not happen that we have such a type.

An option in the tracking code generator is maybe too much as only a very few sites are actually PhoneGap apps. Maybe a FAQ entry? But this will be hard to find. Not sure what to do. FAQ seems like easiest solution for now.

@mattab
Copy link
Member

mattab commented Jul 15, 2015

Created FAQ: How do I track a Phonegap app with Piwik?

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

3 participants