• Resolved Nicolas45

    (@nicolas45)


    Hello,

    I have a problem with the Matomo plugin. This one injects a js script in the response of my API calls (notably for the update of an order in “processing”).
    After invesstigation, it’s line 72 of plugins/matomo/classes/WpMatomo/Ecommerce/Woocommerce.php that injects this code.

    As a result, the response does not have a valid JSON format, and an error is raised.

    Do you know where the problem comes from and how to solve it?

    Here’s an example of the injected code:

    <scripttype="text/javascript">/*<![
    	CDATA[
    		*/window._paq=window._paq||[];window._paq.push([
    			"addEcommerceItem",
    			"sub_month",
    			"Abonnement avec variations",
    			[
    				"Uncategorized"
    			],
    			8.33,
    			1
    		]);window._paq=window._paq||[];window._paq.push([
    			"trackEcommerceOrder",
    			"2825",
    			"9.99",
    			8.33,
    			"1.665",
    			"0",
    			0
    		]);/*
    	]
    ]>*/</script>
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support dizzyatinnocraft

    (@dizzyatinnocraft)

    Hi @nicolas45, apologies for the late reply. This should be resolved in version 5.0.3. Can you check if that version works for you?

    Plugin Support emermatomo

    (@emermatomo)

    Hey @nicholas. Have you already had a look at dizzyatinnocraft’s last comment or maybe any question about it?

    Plugin Support emermatomo

    (@emermatomo)

    Hi @nicolas45 As we didn’t receive a response after 1 week, we’re marking this issue as resolved. If something is not working, feel free to leave a comment and we’d be happy to assist.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Script injection in Woocommerce API response’ is closed to new replies.