Skip to content

Files

Latest commit

9850955 · Apr 18, 2021

History

History
44 lines (30 loc) · 2.12 KB

README.md

File metadata and controls

44 lines (30 loc) · 2.12 KB

ga-ec-posts-wordpress

Plugin to implement impressions and clicks of advanced Analytics commerce in WordPress posts

Forked from here

Discord Banner 2

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

REQUIREMENTS

  • 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

TO DO

Pendant

DONE

Pendant

Contributors