is it correct or not because it show an error when im done that
if(is_page('payment-success')) {
include("/wp-content/ga-ecommerce-tracking/ga-ecommerce-tracking.php");
}
is it correct or not because it show an error when im done that
if(is_page('payment-success')) {
include("/wp-content/ga-ecommerce-tracking/ga-ecommerce-tracking.php");
}
include expects to take a path on the filesystem as its argument. You appear to be passing in root relative URL.
Try to give the full path. You can use dirname(__FILE__)
to get the path of your including script and build from there with the relative path.
Also check what file_exists
tells you about what you want to include.
Include accepts absolute path, relative path or a URL stream as its argument. But you are using a wrong absolute path here. Try making it to relative path ( I am assuming that you are editing a file in Wordpress root directory, if not change the path accordingly)
if(is_page('payment-success')) {
include("./wp-content/ga-ecommerce-tracking/ga-ecommerce-tracking.php");
}