Problem:
Currently, the cache doesn't seem to access the correct URL to be able to download the code from Baidu Analytics' server, resulting in an empty file saved on server.
The main reason for that seems to be that the account tracker is not added as a query string to the Baidu Analytics library tracker URL (See in baidu_analytics.module, lines 277 and 292).
To fix this issue, we could pass the account tracker with the $location parameter each time the function _baidu_analytics_cache would be called, but it might probably be better to refactor this call to ID directly in the Caching function.
Additionally, we could refactor all the remaining calls to http:// protocol, to also potentially add support for https on server.
Please let me know if you would have any questions, objections, comments, suggestions, recommendations or concerns on any aspects of this bug report, I would be glad to provide more information or explain in more details.
Any questions, feedback, testing, changes, ideas or recommendations would be highly appreciated.
Thanks to all in advance.
Comments
Comment #1
dydave commentedQuick follow-up on this bug report:
Modified the file
baidu_analytics.moduleand more particularly the function_baidu_analytics_cacheto directly add the Web Property ID as the query string for the Baidu Analytics library tracker URL to be loaded.Refactored all the calls to
http://directly in the function_baidu_analytics_cachewhich now also double checks for site's server protocol whether it could behttps://.I went ahead and committed the changes against the 7.x-1.x branch at d252653.
These changes seem to have fixed the issue and the correct library tracker file should now be properly downloaded and cached.
I allowed myself to mark this issue as fixed for now, but feel free to re-open it, or post a new ticket, at any time if you have any further objections with this ticket or related commit d252653 (we would surely be happy to hear your feedback).
Please let me know if you would have any further comments, feedback, questions, issues, objections, suggestions or concerns on the commit or this bug report in general, I would be glad to provide more information or explain in more details.
Special thanks to @xiukun.zhou for his help testing, detecting and fixing this issue so quickly.
Thanks in advance to everyone for your testing, reviews, feedback and comments on this issue.
Cheers!