Pixel Manager for WooCommerce – Track Google Analytics, Google Ads, Facebook and more - Version 1.0.6

Version Description

  • Tweak: Switching single pixel function from transient to post meta
Download this release

Release Info

Developer alekv
Plugin Icon 128x128 Pixel Manager for WooCommerce – Track Google Analytics, Google Ads, Facebook and more
Version 1.0.6
Comparing to
See all releases

Code changes from version 0.2.4 to 1.0.6

languages/woocommerce-google-adwords-conversion-tracking-tag-sr_RS.mo ADDED
Binary file
languages/woocommerce-google-adwords-conversion-tracking-tag-sr_RS.po ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: WooCommerce Google AdWords conversion tracking tag\n"
4
+ "POT-Creation-Date: 2015-07-02 06:54+0200\n"
5
+ "PO-Revision-Date: 2015-07-06 09:31+0100\n"
6
+ "Last-Translator: Borisa Djuraskovic <borisad@webhostinghub.com>\n"
7
+ "Language-Team: \n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=UTF-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "X-Generator: Poedit 1.7.4\n"
12
+ "X-Poedit-Basepath: ..\n"
13
+ "X-Poedit-WPHeader: wgact.php\n"
14
+ "X-Poedit-SourceCharset: UTF-8\n"
15
+ "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
16
+ "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
17
+ "_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
18
+ "Language: sr_RS\n"
19
+ "X-Poedit-SearchPath-0: .\n"
20
+ "X-Poedit-SearchPathExcluded-0: *.js\n"
21
+
22
+ #: wgact.php:76
23
+ msgid "Settings"
24
+ msgstr "Podešavanja"
25
+
26
+ #: wgact.php:83
27
+ msgid "AdWords Conversion Tracking"
28
+ msgstr "Trakiranje AdWords konverzije"
29
+
30
+ #: wgact.php:100
31
+ msgid "AdWords Conversion Tracking Settings"
32
+ msgstr "Podešavanja za trakiranje AdWords konverzije"
33
+
34
+ #: wgact.php:109
35
+ msgid "Save Changes"
36
+ msgstr "Sačuvajte izmene"
37
+
38
+ #: wgact.php:121
39
+ msgid "Donation"
40
+ msgstr "Donacija"
41
+
42
+ #: wgact.php:126
43
+ msgid "This plugin was developed by"
44
+ msgstr "Ovaj plugin je razvijen od strane"
45
+
46
+ #: wgact.php:126
47
+ msgid "Buy me a beer if you like the plugin."
48
+ msgstr "Platite mi pivo ako ti se dopada plugin"
49
+
50
+ #: wgact.php:127
51
+ msgid ""
52
+ "If you want me to continue developing the plugin buy me a few more beers. "
53
+ "Although, I probably will continue to develop the plugin anyway. It would be "
54
+ "just much more fun if I had a few beers to celebrate my milestones."
55
+ msgstr ""
56
+ "Ukoliko želite da nastavim da razvijam plugin, platite mi još nekoliko piva. "
57
+ "Mada ću ja verovatno nastaviti da razvijam plugin u svakom slučaju. Samo bi "
58
+ "bilo mnogo zabavnije kada bih imao nekoliko piva da proslavim moje "
59
+ "prekretnice. "
60
+
61
+ #: wgact.php:151
62
+ msgid "Main Settings"
63
+ msgstr "Glavna podešavanja"
64
+
65
+ #: wgact.php:152
66
+ msgid "Conversion ID"
67
+ msgstr "ID konverzije"
68
+
69
+ #: wgact.php:153
70
+ msgid "Conversion Label"
71
+ msgstr "Oznaka konverzije"
72
+
73
+ #. Plugin Name of the plugin/theme
74
+ msgid "WooCommerce Google AdWords conversion tracking tag"
75
+ msgstr "Tag za trakiranje WooCommerce Google AdWords konverzije"
76
+
77
+ #. Plugin URI of the plugin/theme
78
+ msgid ""
79
+ "https://wordpress.org/plugins/woocommerce-google-adwords-conversion-tracking-"
80
+ "tag/"
81
+ msgstr ""
82
+ "https://wordpress.org/plugins/woocommerce-google-adwords-conversion-tracking-"
83
+ "tag/"
84
+
85
+ #. Description of the plugin/theme
86
+ msgid "Google AdWords dynamic conversion value tracking for WooCommerce."
87
+ msgstr ""
88
+ "Trakiranje vrednosti dinamičke konverzije Google AdWords-a za WooCommerce."
89
+
90
+ #. Author of the plugin/theme
91
+ msgid "Wolf & Bär GmbH"
92
+ msgstr "Wolf & Bär GmbH"
93
+
94
+ #. Author URI of the plugin/theme
95
+ msgid "http://www.wolfundbaer.ch"
96
+ msgstr "http://www.wolfundbaer.ch"
readme.txt CHANGED
@@ -3,16 +3,24 @@ Contributors: alekv
3
  Donate link: http://www.wolfundbaer.ch/donations/
4
  Tags: WooCommerce, Google AdWords, AdWords, conversion, conversion value, conversion tag, conversion value tracking, conversion tracking
5
  Requires at least: 3.1
6
- Tested up to: 4.2.2
7
- Stable tag: 0.2.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
- This plugin inserts a Google AdWords conversion tracking tag into the thankyou page of a WooCommerce shop, dynamically measuring the conversion value.
12
 
13
  == Description ==
14
 
15
- This plugin enables Google AdWords conversion value tracking for WooCommerce orders. This is important if you want to measure the ROI of your campaigns.
 
 
 
 
 
 
 
 
16
 
17
  == Installation ==
18
 
@@ -39,6 +47,22 @@ You can send the link to the front page of your shop too if you think it would b
39
 
40
  == Changelog ==
41
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  = 0.2.4 =
43
  * Update: Minor update to the internationalization
44
  = 0.2.3 =
3
  Donate link: http://www.wolfundbaer.ch/donations/
4
  Tags: WooCommerce, Google AdWords, AdWords, conversion, conversion value, conversion tag, conversion value tracking, conversion tracking
5
  Requires at least: 3.1
6
+ Tested up to: 4.4
7
+ Stable tag: 1.0.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ Track the dynamic order value in AdWords from WooCommerce
12
 
13
  == Description ==
14
 
15
+ This plugin tracks the value of WooCommerce orders in Google AdWords. With this you can optimize all your AdWords campaings to achieve maximum efficiency.
16
+
17
+ <strong>Other plugins</strong>
18
+
19
+ If you like this plugin you might like that one too: https://wordpress.org/plugins/woocommerce-google-dynamic-retargeting-tag/
20
+
21
+ <strong>Translations</strong>
22
+
23
+ Thanks to Adrijana Nikolic from http://webhostinggeeks.com for the translation into Serbian.
24
 
25
  == Installation ==
26
 
47
 
48
  == Changelog ==
49
 
50
+ = 1.0.6 =
51
+ * Tweak: Switching single pixel function from transient to post meta
52
+ = 1.0.5 =
53
+ * Fix: Adding session handling to avoid duplications
54
+ = 1.0.4 =
55
+ * Fix: Skipping a tag version
56
+ = 1.0.3 =
57
+ * Fix: Implement different logic to exclude failed orders as the old one is too restrictive
58
+ = 1.0.2 =
59
+ * Fix: Exclude orders where the payment has failed
60
+ = 1.0.1 =
61
+ * New: Banner and icon
62
+ * Update: Name change
63
+ = 1.0 =
64
+ * New: Translation into Serbian by Adrijana Nikolic from http://webhostinggeeks.com
65
+ * Update: Release of version 1.0!
66
  = 0.2.4 =
67
  * Update: Minor update to the internationalization
68
  = 0.2.3 =
wgact.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
  /**
3
- Plugin Name: WooCommerce Google AdWords conversion tracking tag
4
  Plugin URI: https://wordpress.org/plugins/woocommerce-google-adwords-conversion-tracking-tag/
5
  Description: Google AdWords dynamic conversion value tracking for WooCommerce.
6
- Author: Wolf & Bär GmbH
7
  Author URI: http://www.wolfundbaer.ch
8
- Version: 0.2.4
9
  License: GPLv2 or later
10
  Text Domain: woocommerce-google-adwords-conversion-tracking-tag
11
  **/
@@ -123,7 +123,7 @@ A bit more information on that: Unfortunately there is a filter in WordPress (up
123
  <table class="form-table" style="margin: 10px">
124
  <tr>
125
  <th scope="row">
126
- <div style="padding: 10px"><?php esc_html_e( 'This plugin was developed by', 'woocommerce-google-adwords-conversion-tracking-tag' ) ?> <a href="http://www.wolfundbaer.ch" target="_blank">Wolf & Bär GmbH</a><p><?php esc_html_e( 'Buy me a beer if you like the plugin.', 'woocommerce-google-adwords-conversion-tracking-tag' ) ?><br>
127
  <?php esc_html_e( 'If you want me to continue developing the plugin buy me a few more beers. Although, I probably will continue to develop the plugin anyway. It would be just much more fun if I had a few beers to celebrate my milestones.', 'woocommerce-google-adwords-conversion-tracking-tag' ) ?></div>
128
 
129
  <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
@@ -218,17 +218,32 @@ A bit more information on that: Unfortunately there is a filter in WordPress (up
218
  // get order from URL and evaluate order total
219
  $order = new WC_Order( $order_id );
220
  $order_total = $order->get_total();
 
 
 
 
 
 
 
 
 
 
221
  ?>
222
 
223
- <!-- Google Code for Sales (AdWords) Conversion Page -->
224
 
225
  <div style="display:inline;">
226
  <img height="1" width="1" style="border-style:none;" alt="" src="http<?php if(is_ssl()){echo "s";}?>://www.googleadservices.com/pagead/conversion/<?php echo $conversion_id; ?>/?value=<?php echo $order_total; ?>&amp;currency_code=<?php echo $order->get_order_currency(); ?>&amp;label=<?php echo $conversion_label; ?>&amp;guid=ON&amp;script=0"/>
227
  </div>
228
-
229
 
230
- <?php
231
 
 
 
 
 
 
 
232
  }
233
  }
234
 
1
  <?php
2
  /**
3
+ Plugin Name: WooCommerce AdWords Conversion Tracking
4
  Plugin URI: https://wordpress.org/plugins/woocommerce-google-adwords-conversion-tracking-tag/
5
  Description: Google AdWords dynamic conversion value tracking for WooCommerce.
6
+ Author: Wolf + Bär GmbH
7
  Author URI: http://www.wolfundbaer.ch
8
+ Version: 1.0.6
9
  License: GPLv2 or later
10
  Text Domain: woocommerce-google-adwords-conversion-tracking-tag
11
  **/
123
  <table class="form-table" style="margin: 10px">
124
  <tr>
125
  <th scope="row">
126
+ <div style="padding: 10px"><?php esc_html_e( 'This plugin was developed by', 'woocommerce-google-adwords-conversion-tracking-tag' ) ?> <a href="http://www.wolfundbaer.ch" target="_blank">Wolf + Bär GmbH</a><p><?php esc_html_e( 'Buy me a beer if you like the plugin.', 'woocommerce-google-adwords-conversion-tracking-tag' ) ?><br>
127
  <?php esc_html_e( 'If you want me to continue developing the plugin buy me a few more beers. Although, I probably will continue to develop the plugin anyway. It would be just much more fun if I had a few beers to celebrate my milestones.', 'woocommerce-google-adwords-conversion-tracking-tag' ) ?></div>
128
 
129
  <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
218
  // get order from URL and evaluate order total
219
  $order = new WC_Order( $order_id );
220
  $order_total = $order->get_total();
221
+
222
+ // Only run conversion script if the payment has not failed. (has_status('completed') is too restrictive)
223
+ // And use the order meta to check if the conversion code has already run for this order ID. If yes, don't run it again.
224
+ // Unfortunately the WC session gets destroyed for not logged in users which is why I solved this with a transient and left the WC session code for testing purposes.
225
+ // source: https://docs.woothemes.com/wc-apidocs/class-WC_Session.html
226
+ // source: http://stackoverflow.com/questions/27199656/how-to-use-session-in-woocommerce-pages-like-we-use-normal-php-session
227
+ // WC()->session->set_customer_session_cookie(true); // Try to reactivate WC session to keep session state
228
+ // if ( !$order->has_status( 'failed' ) && ((WC()->session->get( 'single_conversion_identifier' ) != $order_id))){
229
+ // if ( !$order->has_status( 'failed' ) && ((get_transient( 'wgact_transient_ID_' . $order_id ) != $order_id))){
230
+ if ( !$order->has_status( 'failed' ) && ((get_post_meta( $order_id, '_WGACT_conversion_pixel_fired' , true) != "true"))){
231
  ?>
232
 
233
+ <!-- START Google Code for Sales (AdWords) Conversion Page -->
234
 
235
  <div style="display:inline;">
236
  <img height="1" width="1" style="border-style:none;" alt="" src="http<?php if(is_ssl()){echo "s";}?>://www.googleadservices.com/pagead/conversion/<?php echo $conversion_id; ?>/?value=<?php echo $order_total; ?>&amp;currency_code=<?php echo $order->get_order_currency(); ?>&amp;label=<?php echo $conversion_label; ?>&amp;guid=ON&amp;script=0"/>
237
  </div>
 
238
 
239
+ <!-- END Google Code for Sales (AdWords) Conversion Page -->
240
 
241
+ <?php
242
+ // Set the order ID meta after the conversion code has run once.
243
+ // WC()->session->set( 'single_conversion_identifier' , $order_id );
244
+ //set_transient( 'wgact_transient_ID_' . $order_id, $order_id, 60*60*12 );
245
+ update_post_meta( $order_id, '_WGACT_conversion_pixel_fired', 'true' );
246
+ } // end if order status
247
  }
248
  }
249