Quantcast
Channel: Support & Bugs - Matomo forums
Viewing all articles
Browse latest Browse all 5706

Download a Matomo Widget with cURL

$
0
0

@Kiusau wrote:

What is the proper way to download a Matomo widget with cURL? The following code succeeds in obtaining what appears to be the widget’s HTML, but all of the CSS, javascript functionality, and imagery are lost.

    $url = 'https://www.nudge.online ... matomo/index.php?module=Widgetize&action=iframe&widget=1&moduleToWidgetize=Live&actionToWidgetize=widget&idSite=1&period=day&date=today&disableLink=1&token_auth=...';
    $curl_request = curl_init();
    curl_setopt($curl_request, CURLOPT_URL, $url);
    curl_setopt($curl_request, CURLOPT_RETURNTRANSFER, 0);
    if(curl_exec($curl_request) === false) {
        echo 'Curl error: ' . curl_error($curl_request);
    } else {
        echo 'Operation completed without any errors';
    }

Roddy

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 5706

Trending Articles