Plugin to implement impressions and clicks of advanced Analytics commerce in WordPress posts
Forked from here
For now, it's necessary to insert the following onclick event in the links of the file where the posts loop is called:
onclick="productObject('<?php the_title(); ?>','<?php the_ID(); ?>','<?php echo get_the_author_meta('ID'); ?>','<?php $cat = get_the_category(); echo $cat[0]->cat_name; ?>','<?php $posttags = get_the_tags();
if ($posttags) {i
foreach($posttags as $tag) {
echo $tag->name . ', ';
}
} ?>','<?php wp_title(); ?>','<?php the_permalink(); ?>')"
The file changes depending on the theme, in the flymag WordPress theme for example, it is the content.php
- You need to have Google Analytics installed in WordPress for the plugin to work
- You need to have the Advanced Trade part of Google Analytics activated
- To activate this, access the Manage of Google Analytics, in the Views column in Electronic Commerce Configuration activate the two options and save.
- Insert the code of the onclick above given in the links to the articles
Pendant
Pendant