Change data on the fly - Event GA

     

On my site wants to change data on the fly (Wordpress).


So that the name of the product was downloaded from the page code and was auto-injected into Even GA.


I created this code:


$out_name = $b;  preg_match('~([ <]*)~Usmi' $out_name $name);  $name_product = $name[1];
$what[] = 'class="OfferLink">';  $on[] = 'itemscope="" itemtype="http://schema.org/Offer" onclick="ga('send'