Jump to content

Using cURL to Embed an HTML-Formatted Widget


Recommended Posts

BACKGROUND:  Recently I learned how to embed directly a Matomo widget into my website.  Although there are several ways to make this happen, I am only able to achieve two of them at this time:  one, gives all autonomous users access to all Matomo's reporting widgets and a large number of reporting methods; the other, exposes the superuser's authorization token that would leave a disastrous breach in database security. 

DILEMMA:  Although I am able to retrieve the widget via CURL in an invisible PHP file, and consequently embed the widget's contents via the src attribute of an iframe, I am not able to do so with the same rich formatting that can be achieved when the same HTTP request is placed directly into the src attribute of the iframe.  Either cURL is stripping away valuable information or the Browser is unable to process the information provided in the format provided.

QUESTION:  What must I do in order to get cURL to behave in a manner that produces information compatible with an ordinary web-browser?




Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...