嵌入式piwik在rails中

I am install piwik in my local system and integrate with rails application for tracking there is problem when i am using iframe for Analytic data by piwik i want to show dashboard inside my rails app iframe. But it's showing errors

Error Oops… there was a problem during the request. Maybe the server had a temporary issue, or maybe you requested a report with too much data. Please try again. If this error occurs repeatedly please contact your Piwik administrator for assistance.

My config file config.ini.php

cors_domains[] = "*"
enable_framed_pages = 1
enable_framed_settings = 1

trusted_hosts[] = "192.168.1.101"
trusted_hosts[]= "localhost/analytics/piwik/"

In my firebug Error

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost/analytics/piwik/index.php?date=yesterday&module=Dashboard&action=embeddedIndex&idSite=1%252C2&period=day&idDashboard=1. (Reason: missing token 'x-requested-with' in CORS header 'Access-Control-Allow-Headers' from CORS preflight channel).

My erb.slim file is

.panel.panel-primary
  .panel-heading
    h4 Piwik
    iframe height="200"sandbox="allow-scripts" width="600px;" src="http://localhost/analytics/piwik/"

If we need full dashboard of piwik then we simply login via admin cred , and go to the Widgets panel and copy that <iframe> code and paste is to your application.

Example: Piwik dashboard integration with iframe CORS

Your also set user login by its &token_auth=xxxx

It will provide you login functionality. Just put the token_auth after end of url.

In my case user with only view permission.

http://localhost/analytics/piwik/index.php?module=Widgetize&action=iframe&moduleToWidgetize=Dashboard&actionToWidgetize=index&idSite=1&period=week&date=yesterday&token_auth=xxxxxxx