Problem:
Currently, Baidu Analytics would seem to have a slightly different way of handling custom URLs passed to _hmt.push(["_trackPageview".

It seems we wouldn't necessarily need to encode with JSON the tracked URL as it is currently:
$url_custom = drupal_json_encode(url('node/' . $source_node->nid, array('language' => $languages[$source_node->language])));
and we could perhaps just pass the URL as mentioned in Baidu Analytics JavaScript API for _trackPageview:
_hmt.push(['_trackPageview', '/example/login']);
 
Currently, there is a problem of display for these tracked URLs in the Baidu Analytics Reporting platform.
 
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

dydave’s picture

Title: Fix display of tracked URL for Original translation » Fix display of tracked URLs for Original source translations
Status: Active » Fixed

Quick follow-up on this bug report:

Modified the file baidu_analytics.module and more particularly the function baidu_analytics_page_alter to remove the calls to drupal_json_encode as suggested in the issue summary, see baidu_analytics.module-commit-79ce0a4-diff.

Also modified the code to add the JavaScript _hmt.push(['_trackPageview' to directly include double quotes around the custom URL to be tracked.

I went ahead and committed the changes against the 7.x-1.x branch at 79ce0a4.

These changes seem to have fixed the issue and the correct URL of the tracked translation source node page should now be correctly displayed in Baidu Analytics Reporting platform.

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 79ce0a4 (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 great help on this issue and coming up with a proper solution.
Thanks in advance to everyone for your testing, reviews, feedback and comments on this issue.
Cheers!

dydave’s picture

Further follow up on this issue:

A similar problem was found for the tracking of messages and a patch was committed at ce1f68a.

Tracked messages shouldn't have " double quotes in the message label anymore.

Please let me know if you would have any further comments, feedback, questions, issues, objections, suggestions or concerns on the commits or this bug report in general, I would be glad to provide more information or explain in more details.

Thanks in advance to everyone for your testing, reviews, feedback and comments on this issue.
Cheers!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.