Open rbraun75 opened 7 years ago
Adding the analaytics property
$properties[AMPArticle::ANALYTICS_KEY] = array( '<amp-pixel src="http://mydomain.com/my_tracking_pixel.gif">', '<amp-analytics config="https://mydomain.com/analytics.config.json"></amp-analytics>' );
from your quick start example and rendering the article throws an Error:
Error: Call to undefined method Facebook\InstantArticles\AMP\AMPArticle::getContext() in Facebook\InstantArticles\AMP\AMPArticle->buildAnalytics() (line 207 of [...]vendor/facebook/facebook-instant-articles-sdk-extensions-in-php/src/Facebook/InstantArticles/AMP/AMPArticle.php). Facebook\InstantArticles\AMP\AMPArticle->buildAnalytics() (Line: 281) Facebook\InstantArticles\AMP\AMPArticle->transformInstantArticle(Object) (Line: 189) Facebook\InstantArticles\AMP\AMPArticle->toDOMElement(Object) (Line: 38) Facebook\InstantArticles\Elements\Element->render('', 1) (Line: 145) Facebook\InstantArticles\AMP\AMPArticle->render() (Line: 55)
There is no getContext() method in AMPArticle, so adding analytics the way described in your example does not work.
Analytics text in rendered AMP Article markup.
I have the same problem.
Problem noticed
Adding the analaytics property
from your quick start example and rendering the article throws an Error:
There is no getContext() method in AMPArticle, so adding analytics the way described in your example does not work.
Expected result
Analytics text in rendered AMP Article markup.