PixelYourSite – Facebook Pixel (Events, WooCommerce & Easy Digital Downloads) - Version 7.1.3

Version Description

Download this release

Release Info

Developer PixelYourSite
Plugin Icon 128x128 PixelYourSite – Facebook Pixel (Events, WooCommerce & Easy Digital Downloads)
Version 7.1.3
Comparing to
See all releases

Code changes from version 7.1.2 to 7.1.3

facebook-pixel-master.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: PixelYourSite
5
  * Plugin URI: http://www.pixelyoursite.com/
6
  * Description: No codding <strong>Facebook Pixel</strong> and <strong>Google Analytics</strong> install. Track key actions with our Global Events, or configure your own events. WooCommerce and EDD fully supported, with Facebook Dynamic Ads Pixel set-up and Google Analytics Enhanced Ecommerce. Insert any custom script with our Head & Footer option. Add the <strong>Pinterest Tag</strong> with our free add-on. The PRO version adds support for the Google Ads tag plus a lot of extra stuff.
7
- * Version: 7.1.2
8
  * Author: PixelYourSite
9
  * Author URI: http://www.pixelyoursite.com
10
  * License: GPLv3
4
  * Plugin Name: PixelYourSite
5
  * Plugin URI: http://www.pixelyoursite.com/
6
  * Description: No codding <strong>Facebook Pixel</strong> and <strong>Google Analytics</strong> install. Track key actions with our Global Events, or configure your own events. WooCommerce and EDD fully supported, with Facebook Dynamic Ads Pixel set-up and Google Analytics Enhanced Ecommerce. Insert any custom script with our Head & Footer option. Add the <strong>Pinterest Tag</strong> with our free add-on. The PRO version adds support for the Google Ads tag plus a lot of extra stuff.
7
+ * Version: 7.1.3
8
  * Author: PixelYourSite
9
  * Author URI: http://www.pixelyoursite.com
10
  * License: GPLv3
includes/class-events-manager.php CHANGED
@@ -227,6 +227,7 @@ class EventsManager {
227
  if ( isEventEnabled( 'woo_add_to_cart_enabled') && PYS()->getOption( 'woo_add_to_cart_on_button_click' ) ) {
228
  add_action( 'woocommerce_after_shop_loop_item', array( $this, 'setupWooLoopProductData' ) );
229
  add_action( 'woocommerce_after_add_to_cart_button', array( $this, 'setupWooSingleProductData' ) );
 
230
  }
231
 
232
  // ViewContent
@@ -278,8 +279,19 @@ class EventsManager {
278
 
279
  }
280
 
281
- public function setupWooLoopProductData() {
282
- global $product;
 
 
 
 
 
 
 
 
 
 
 
283
 
284
  if ( wooProductIsType( $product, 'variable' ) ) {
285
  return; // skip variable products
227
  if ( isEventEnabled( 'woo_add_to_cart_enabled') && PYS()->getOption( 'woo_add_to_cart_on_button_click' ) ) {
228
  add_action( 'woocommerce_after_shop_loop_item', array( $this, 'setupWooLoopProductData' ) );
229
  add_action( 'woocommerce_after_add_to_cart_button', array( $this, 'setupWooSingleProductData' ) );
230
+ add_filter( 'woocommerce_blocks_product_grid_item_html', array( $this, 'setupWooBlocksProductData' ), 10, 3 );
231
  }
232
 
233
  // ViewContent
279
 
280
  }
281
 
282
+ public function setupWooLoopProductData()
283
+ {
284
+ global $product;
285
+ $this->setupWooProductData($product);
286
+ }
287
+
288
+ public function setupWooBlocksProductData($html, $data, $product)
289
+ {
290
+ $this->setupWooProductData($product);
291
+ return $html;
292
+ }
293
+
294
+ public function setupWooProductData($product) {
295
 
296
  if ( wooProductIsType( $product, 'variable' ) ) {
297
  return; // skip variable products
includes/functions-admin.php CHANGED
@@ -676,7 +676,7 @@ function renderDummyGoogleAdsConversionLabelInputs() {
676
  <?php
677
  }
678
 
679
- function renderProBadge( $url = null ) {
680
 
681
  if ( ! $url ) {
682
  $url = 'https://www.pixelyoursite.com/';
@@ -684,7 +684,7 @@ function renderProBadge( $url = null ) {
684
 
685
  $url = untrailingslashit( $url ) . '/?utm_source=pys-free-plugin&utm_medium=pro-badge&utm_campaign=pro-feature';
686
 
687
- echo '&nbsp;<a href="' . esc_url( $url ) . '" target="_blank" class="badge badge-pill badge-pro">Pro Feature <i class="fa fa-external-link" aria-hidden="true"></i></a>';
688
  }
689
 
690
  function renderSpBadge() {
676
  <?php
677
  }
678
 
679
+ function renderProBadge( $url = null,$label = "Pro Feature" ) {
680
 
681
  if ( ! $url ) {
682
  $url = 'https://www.pixelyoursite.com/';
684
 
685
  $url = untrailingslashit( $url ) . '/?utm_source=pys-free-plugin&utm_medium=pro-badge&utm_campaign=pro-feature';
686
 
687
+ echo '&nbsp;<a href="' . esc_url( $url ) . '" target="_blank" class="badge badge-pill badge-pro">'.$label.' <i class="fa fa-external-link" aria-hidden="true"></i></a>';
688
  }
689
 
690
  function renderSpBadge() {
includes/functions-common.php CHANGED
@@ -497,7 +497,7 @@ function endsWith( $haystack, $needle ) {
497
  }
498
 
499
  function getCurrentPageUrl() {
500
- return untrailingslashit( $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
501
  }
502
 
503
  function removeProtocolFromUrl( $url ) {
@@ -520,7 +520,7 @@ function removeProtocolFromUrl( $url ) {
520
  $url = str_replace( array( 'http://', 'https://', 'http://www.', 'https://www.', 'www.' ), '', $url );
521
  $url = trim( $url );
522
  $url = ltrim( $url, '/' );
523
- $url = rtrim( $url, '/' );
524
 
525
  return $url;
526
 
497
  }
498
 
499
  function getCurrentPageUrl() {
500
+ return $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ;
501
  }
502
 
503
  function removeProtocolFromUrl( $url ) {
520
  $url = str_replace( array( 'http://', 'https://', 'http://www.', 'https://www.', 'www.' ), '', $url );
521
  $url = trim( $url );
522
  $url = ltrim( $url, '/' );
523
+ //$url = rtrim( $url, '/' );
524
 
525
  return $url;
526
 
includes/views/html-main-edd.php CHANGED
@@ -164,25 +164,91 @@ if ( ! defined( 'ABSPATH' ) ) {
164
 
165
  <?php endif; ?>
166
 
167
- <!-- Google Dynamic Remarketing Vertical -->
168
- <div class="card card-static card-disabled">
169
- <div class="card-header">
170
- Google Dynamic Remarketing Vertical <?php renderProBadge( 'https://www.pixelyoursite.com/google-analytics' ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
171
  </div>
172
- <div class="card-body">
173
- <div class="row">
174
- <div class="col-11">
175
- <div class="custom-controls-stacked">
176
- <?php renderDummyRadioInput( 'Use Retail Vertical (select this if you have access to Google Merchant)', true ); ?>
177
- <?php renderDummyRadioInput( 'Use Custom Vertical (select this if Google Merchant is not available for your country)' ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
178
  </div>
179
  </div>
180
- <div class="col-1">
181
- <?php renderPopoverButton( 'google_dynamic_remarketing_vertical' ); ?>
 
 
 
 
 
 
 
 
 
182
  </div>
183
  </div>
184
  </div>
185
- </div>
 
 
 
 
 
 
 
 
186
 
187
  <?php if ( Bing()->enabled() ) : ?>
188
  <div class="card card-static">
@@ -190,21 +256,61 @@ if ( ! defined( 'ABSPATH' ) ) {
190
  Bing ID setting
191
  </div>
192
  <div class="card-body">
193
- <div class="row">
194
  <div class="col col-offset-left form-inline">
195
- <label>Product ID</label>
196
  <?php Bing()->render_select_input( 'edd_content_id',
197
  array(
198
- 'product_id' => 'Download ID',
199
- 'product_sku' => 'Download SKU',
200
  )
201
  ); ?>
202
  </div>
203
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
204
  </div>
205
  </div>
206
  <?php endif; ?>
207
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
208
  <!-- Event Value -->
209
  <div class="card card-static card-disabled">
210
  <div class="card-header">
@@ -263,7 +369,7 @@ if ( ! defined( 'ABSPATH' ) ) {
263
  <?php if ( Pinterest()->enabled() ) : ?>
264
  <div class="row">
265
  <div class="col">
266
- <?php Pinterest()->render_switcher_input( 'edd_purchase_enabled' ); ?>
267
  <h4 class="switcher-label">Enable the Checkout event on Pinterest</h4>
268
  <?php Pinterest()->renderAddonNotice(); ?>
269
  </div>
@@ -617,7 +723,7 @@ if ( ! defined( 'ABSPATH' ) ) {
617
  <?php if ( Pinterest()->enabled() ) : ?>
618
  <div class="row">
619
  <div class="col">
620
- <?php Pinterest()->render_switcher_input( 'edd_view_content_enabled' ); ?>
621
  <h4 class="switcher-label">Enable the PageVisit event on Pinterest</h4>
622
  <?php Pinterest()->renderAddonNotice(); ?>
623
  </div>
164
 
165
  <?php endif; ?>
166
 
167
+ <?php if ( GA()->enabled() ) : ?>
168
+
169
+ <div class="card card-static" id="pys-section-ga-id">
170
+ <div class="card-header">
171
+ Google Analytics ID setting
172
+ </div>
173
+ <div class="card-body">
174
+ <div class="row mb-3">
175
+ <div class="col col-offset-left form-inline">
176
+ <label>ecomm_prodid</label>
177
+ <?php GA()->render_select_input( 'edd_content_id',
178
+ array(
179
+ 'download_id' => 'Download ID',
180
+ 'download_sku' => 'Download SKU',
181
+ )
182
+ ); ?>
183
+ </div>
184
+ </div>
185
+ <div class="row mb-3">
186
+ <div class="col col-offset-left form-inline">
187
+ <label>ecomm_prodid prefix</label><?php GA()->render_text_input( 'edd_content_id_prefix', '(optional)' ); ?>
188
+ </div>
189
+ </div>
190
+ <div class="row">
191
+ <div class="col col-offset-left form-inline">
192
+ <label>ecomm_prodid suffix</label><?php GA()->render_text_input( 'edd_content_id_suffix', '(optional)' ); ?>
193
+ </div>
194
+ </div>
195
+ </div>
196
  </div>
197
+ <?php endif; ?>
198
+
199
+
200
+ <div class="card card-static card-disabled">
201
+ <div class="card-header">
202
+ Google Ads ID Settings
203
+ <?php renderProBadge( 'https://www.pixelyoursite.com/google-analytics?utm_source=pys-free-plugin&utm_medium=pro-badg
204
+ e&utm_campaign=pro-feature' ); ?>
205
+ </div>
206
+
207
+ </div>
208
+
209
+
210
+ <?php if ( Pinterest()->enabled() ) : ?>
211
+
212
+ <div class="card card-static" id="pys-section-ga-id">
213
+ <div class="card-header">
214
+ Pinterest Tag ID setting
215
+ </div>
216
+ <div class="card-body">
217
+
218
+ <div class="row mb-3">
219
+ <div class="col col-offset-left form-inline">
220
+ <label>ID</label>
221
+ <?php Pinterest()->render_select_input( 'edd_content_id',
222
+ array(
223
+ 'download_id' => 'Download ID',
224
+ 'download_sku' => 'Download SKU',
225
+ )
226
+ ); ?>
227
  </div>
228
  </div>
229
+ <div class="row mb-3">
230
+ <div class="col-11 col-offset-left form-inline">
231
+ <label>ID prefix</label><?php Pinterest()->render_text_input( 'edd_content_id_prefix',
232
+ '(optional)' ); ?>
233
+ </div>
234
+ </div>
235
+ <div class="row">
236
+ <div class="col-11 col-offset-left form-inline">
237
+ <label>ID suffix</label><?php Pinterest()->render_text_input( 'edd_content_id_suffix',
238
+ '(optional)' ); ?>
239
+ </div>
240
  </div>
241
  </div>
242
  </div>
243
+ <?php else: ?>
244
+ <div class="card card-static card-disabled" id="pys-section-ga-id">
245
+ <div class="card-header">
246
+ Pinterest Tag ID setting
247
+ <?php renderProBadge("https://www.pixelyoursite.com/pinterest-tag?utm_source=pys-free-plugin&utm_medium=pinterest-badge&utm_campaign=requiere-free-add-on",
248
+ "Requires free add-on"); ?>
249
+ </div>
250
+ </div>
251
+ <?php endif; ?>
252
 
253
  <?php if ( Bing()->enabled() ) : ?>
254
  <div class="card card-static">
256
  Bing ID setting
257
  </div>
258
  <div class="card-body">
259
+ <div class="row mb-3">
260
  <div class="col col-offset-left form-inline">
261
+ <label>ID</label>
262
  <?php Bing()->render_select_input( 'edd_content_id',
263
  array(
264
+ 'download_id' => 'Download ID',
265
+ 'download_sku' => 'Download SKU',
266
  )
267
  ); ?>
268
  </div>
269
  </div>
270
+ <div class="row mb-3">
271
+ <div class="col-11 col-offset-left form-inline">
272
+ <label>ID prefix</label><?php Bing()->render_text_input( 'edd_content_id_prefix',
273
+ '(optional)' ); ?>
274
+ </div>
275
+ </div>
276
+ <div class="row">
277
+ <div class="col-11 col-offset-left form-inline">
278
+ <label>ID suffix</label><?php Bing()->render_text_input( 'edd_content_id_suffix',
279
+ '(optional)' ); ?>
280
+ </div>
281
+ </div>
282
+ </div>
283
+ </div>
284
+ <?php else: ?>
285
+ <div class="card card-static card-disabled">
286
+ <div class="card-header">
287
+ Bing Tag ID setting
288
+ <?php renderProBadge( 'https://www.pixelyoursite.com/bing-tag?utm_source=pixelyoursite-free-plugin&utm_medium=plugin&utm_campaign=free-plugin-bing',
289
+ "Requires paid add-on"); ?>
290
  </div>
291
  </div>
292
  <?php endif; ?>
293
 
294
+ <!-- Google Dynamic Remarketing Vertical -->
295
+ <div class="card card-static card-disabled">
296
+ <div class="card-header">
297
+ Google Dynamic Remarketing Vertical <?php renderProBadge( 'https://www.pixelyoursite.com/google-analytics' ); ?>
298
+ </div>
299
+ <div class="card-body">
300
+ <div class="row">
301
+ <div class="col-11">
302
+ <div class="custom-controls-stacked">
303
+ <?php renderDummyRadioInput( 'Use Retail Vertical (select this if you have access to Google Merchant)', true ); ?>
304
+ <?php renderDummyRadioInput( 'Use Custom Vertical (select this if Google Merchant is not available for your country)' ); ?>
305
+ </div>
306
+ </div>
307
+ <div class="col-1">
308
+ <?php renderPopoverButton( 'google_dynamic_remarketing_vertical' ); ?>
309
+ </div>
310
+ </div>
311
+ </div>
312
+ </div>
313
+
314
  <!-- Event Value -->
315
  <div class="card card-static card-disabled">
316
  <div class="card-header">
369
  <?php if ( Pinterest()->enabled() ) : ?>
370
  <div class="row">
371
  <div class="col">
372
+ <?php Pinterest()->render_switcher_input( 'edd_checkout_enabled' ); ?>
373
  <h4 class="switcher-label">Enable the Checkout event on Pinterest</h4>
374
  <?php Pinterest()->renderAddonNotice(); ?>
375
  </div>
723
  <?php if ( Pinterest()->enabled() ) : ?>
724
  <div class="row">
725
  <div class="col">
726
+ <?php Pinterest()->render_switcher_input( 'edd_page_visit_enabled' ); ?>
727
  <h4 class="switcher-label">Enable the PageVisit event on Pinterest</h4>
728
  <?php Pinterest()->renderAddonNotice(); ?>
729
  </div>
includes/views/html-main-woo.php CHANGED
@@ -221,59 +221,121 @@ use PixelYourSite\Facebook\Helpers;
221
 
222
  <?php endif; ?>
223
 
224
- <!-- Google Ads Settings -->
225
- <div class="card card-static card-disabled">
226
- <div class="card-header">
227
- Google Ads Settings <?php renderProBadge( 'https://www.pixelyoursite.com/google-analytics' ); ?>
228
- </div>
229
- <div class="card-body">
230
- <div class="row mb-3">
231
- <div class="col-11 col-offset-left form-inline">
232
- <label>Product ID prefix</label>
233
- <?php renderDummyTextInput( '(optional)' ); ?>
 
 
 
234
  </div>
235
- <div class="col-1">
236
- <?php renderPopoverButton( 'ads_woo_item_id_prefix' ); ?>
 
 
 
 
 
 
 
 
237
  </div>
238
- </div>
239
- <div class="row">
240
- <div class="col-11 col-offset-left form-inline">
241
- <label>Product ID suffix</label>
242
- <?php renderDummyTextInput( '(optional)' ); ?>
 
 
 
 
243
  </div>
244
  </div>
245
  </div>
246
- </div>
247
 
248
- <!-- Google Dynamic Remarketing Vertical -->
 
249
  <div class="card card-static card-disabled">
250
  <div class="card-header">
251
- Google Dynamic Remarketing Vertical <?php renderProBadge( 'https://www.pixelyoursite.com/google-analytics' ); ?>
 
252
  </div>
253
- <div class="card-body">
254
- <div class="row">
255
- <div class="col-11">
256
- <div class="custom-controls-stacked">
257
- <?php renderDummyRadioInput( 'Use Retail Vertical (select this if you have access to Google Merchant)' , true ); ?>
258
- <?php renderDummyRadioInput( 'Use Custom Vertical (select this if Google Merchant is not available for your country)' ); ?>
 
 
 
 
 
 
 
 
 
259
  </div>
260
  </div>
261
- <div class="col-1">
262
- <?php renderPopoverButton( 'google_dynamic_remarketing_vertical' ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
263
  </div>
264
  </div>
265
  </div>
266
- </div>
 
 
 
 
 
 
 
 
267
 
 
 
268
  <?php if ( Bing()->enabled() ) : ?>
269
  <div class="card card-static">
270
  <div class="card-header">
271
- Bing ID setting
272
  </div>
273
  <div class="card-body">
274
- <div class="row">
 
 
 
 
 
 
 
 
275
  <div class="col col-offset-left form-inline">
276
- <label>Product ID</label>
277
  <?php Bing()->render_select_input( 'woo_content_id',
278
  array(
279
  'product_id' => 'Product ID',
@@ -282,10 +344,50 @@ use PixelYourSite\Facebook\Helpers;
282
  ); ?>
283
  </div>
284
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
285
  </div>
286
  </div>
287
  <?php endif; ?>
288
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
289
  <!-- Event Value -->
290
  <div class="card card-static card-disabled">
291
  <div class="card-header">
@@ -346,7 +448,7 @@ use PixelYourSite\Facebook\Helpers;
346
  <?php if ( Pinterest()->enabled() ) : ?>
347
  <div class="row">
348
  <div class="col">
349
- <?php Pinterest()->render_switcher_input( 'woo_purchase_enabled' ); ?>
350
  <h4 class="switcher-label">Enable the Checkout event on Pinterest</h4>
351
  <?php Pinterest()->renderAddonNotice(); ?>
352
  </div>
@@ -699,7 +801,7 @@ use PixelYourSite\Facebook\Helpers;
699
  <?php if ( Pinterest()->enabled() ) : ?>
700
  <div class="row">
701
  <div class="col">
702
- <?php Pinterest()->render_switcher_input( 'woo_view_content_enabled' ); ?>
703
  <h4 class="switcher-label">Enable the PageVisit event on Pinterest</h4>
704
  <?php Pinterest()->renderAddonNotice(); ?>
705
  </div>
221
 
222
  <?php endif; ?>
223
 
224
+ <?php if ( GA()->enabled() ) : ?>
225
+
226
+ <div class="card card-static" id="pys-section-ga-id">
227
+ <div class="card-header">
228
+ Google Analytics ID setting
229
+ </div>
230
+ <div class="card-body">
231
+ <div class="row mb-3">
232
+ <div class="col">
233
+ <?php GA()->render_switcher_input( 'woo_variable_as_simple' ); ?>
234
+ <h4 class="switcher-label">Treat variable products like simple products</h4>
235
+ <p class="mt-3">If you enable this option, the main ID will be used instead of the variation ID.</p>
236
+ </div>
237
  </div>
238
+ <div class="row mb-3">
239
+ <div class="col col-offset-left form-inline">
240
+ <label>ecomm_prodid</label>
241
+ <?php GA()->render_select_input( 'woo_content_id',
242
+ array(
243
+ 'product_id' => 'Product ID',
244
+ 'product_sku' => 'Product SKU',
245
+ )
246
+ ); ?>
247
+ </div>
248
  </div>
249
+ <div class="row mb-3">
250
+ <div class="col col-offset-left form-inline">
251
+ <label>ecomm_prodid prefix</label><?php GA()->render_text_input( 'woo_content_id_prefix', '(optional)' ); ?>
252
+ </div>
253
+ </div>
254
+ <div class="row">
255
+ <div class="col col-offset-left form-inline">
256
+ <label>ecomm_prodid suffix</label><?php GA()->render_text_input( 'woo_content_id_suffix', '(optional)' ); ?>
257
+ </div>
258
  </div>
259
  </div>
260
  </div>
261
+ <?php endif; ?>
262
 
263
+
264
+ <!-- Google Ads Settings -->
265
  <div class="card card-static card-disabled">
266
  <div class="card-header">
267
+ Google Ads ID Setting <?php renderProBadge( 'https://www.pixelyoursite.com/google-analytics?utm_source=pys-free-plugin&utm_medium=pro-badg
268
+ e&utm_campaign=pro-feature' ); ?>
269
  </div>
270
+
271
+ </div>
272
+
273
+ <?php if ( Pinterest()->enabled() ) : ?>
274
+
275
+ <div class="card card-static" id="pys-section-ga-id">
276
+ <div class="card-header">
277
+ Pinterest Tag ID setting
278
+ </div>
279
+ <div class="card-body">
280
+ <div class="row mb-3">
281
+ <div class="col">
282
+ <?php Pinterest()->render_switcher_input( 'woo_variable_as_simple' ); ?>
283
+ <h4 class="switcher-label">Treat variable products like simple products</h4>
284
+ <p class="mt-3">If you enable this option, the main ID will be used instead of the variation ID.</p>
285
  </div>
286
  </div>
287
+ <div class="row mb-3">
288
+ <div class="col col-offset-left form-inline">
289
+ <label>ID</label>
290
+ <?php Pinterest()->render_select_input( 'woo_content_id',
291
+ array(
292
+ 'product_id' => 'Product ID',
293
+ 'product_sku' => 'Product SKU',
294
+ )
295
+ ); ?>
296
+ </div>
297
+ </div>
298
+ <div class="row mb-3">
299
+ <div class="col col-offset-left form-inline">
300
+ <label>ID prefix</label><?php Pinterest()->render_text_input( 'woo_content_id_prefix', '(optional)' ); ?>
301
+ </div>
302
+ </div>
303
+ <div class="row">
304
+ <div class="col col-offset-left form-inline">
305
+ <label>ID suffix</label><?php Pinterest()->render_text_input( 'woo_content_id_suffix', '(optional)' ); ?>
306
+ </div>
307
  </div>
308
  </div>
309
  </div>
310
+ <?php else: ?>
311
+ <div class="card card-static card-disabled" id="pys-section-ga-id">
312
+ <div class="card-header">
313
+ Pinterest Tag ID setting
314
+ <?php renderProBadge( 'https://www.pixelyoursite.com/pinterest-tag?utm_source=pys-free-plugin&utm_medium=pinterest-badge&utm_campaign=requiere-free-add-on',
315
+ "Requires free add-on"); ?>
316
+ </div>
317
+ </div>
318
+ <?php endif; ?>
319
 
320
+ <!-- @todo: update UI -->
321
+ <!-- @todo: hide for dummy Bing -->
322
  <?php if ( Bing()->enabled() ) : ?>
323
  <div class="card card-static">
324
  <div class="card-header">
325
+ Bing Tag ID setting
326
  </div>
327
  <div class="card-body">
328
+
329
+ <div class="row mb-3">
330
+ <div class="col">
331
+ <?php Bing()->render_switcher_input( 'woo_variable_as_simple' ); ?>
332
+ <h4 class="switcher-label">Treat variable products like simple products</h4>
333
+ <p class="mt-3">If you enable this option, the main ID will be used instead of the variation ID.</p>
334
+ </div>
335
+ </div>
336
+ <div class="row mb-3">
337
  <div class="col col-offset-left form-inline">
338
+ <label>ID</label>
339
  <?php Bing()->render_select_input( 'woo_content_id',
340
  array(
341
  'product_id' => 'Product ID',
344
  ); ?>
345
  </div>
346
  </div>
347
+ <div class="row mb-3">
348
+ <div class="col col-offset-left form-inline">
349
+ <label>ID prefix</label><?php Bing()->render_text_input( 'woo_content_id_prefix', '(optional)' ); ?>
350
+ </div>
351
+ </div>
352
+ <div class="row">
353
+ <div class="col col-offset-left form-inline">
354
+ <label>ID suffix</label><?php Bing()->render_text_input( 'woo_content_id_suffix', '(optional)' ); ?>
355
+ </div>
356
+ </div>
357
+ </div>
358
+ </div>
359
+ <?php else : ?>
360
+ <div class="card card-static card-disabled">
361
+ <div class="card-header">
362
+ Bing Tag ID setting
363
+ <?php renderProBadge( 'https://www.pixelyoursite.com/bing-tag?utm_source=pixelyoursite-free-plugin&utm_medium=plugin&utm_campaign=free-plugin-bing',
364
+ "Requires paid add-on"); ?>
365
  </div>
366
  </div>
367
  <?php endif; ?>
368
 
369
+ <!-- Google Dynamic Remarketing Vertical -->
370
+ <div class="card card-static card-disabled">
371
+ <div class="card-header">
372
+ Google Dynamic Remarketing Vertical <?php renderProBadge( 'https://www.pixelyoursite.com/google-analytics' ); ?>
373
+ </div>
374
+ <div class="card-body">
375
+ <div class="row">
376
+ <div class="col-11">
377
+ <div class="custom-controls-stacked">
378
+ <?php renderDummyRadioInput( 'Use Retail Vertical (select this if you have access to Google Merchant)' , true ); ?>
379
+ <?php renderDummyRadioInput( 'Use Custom Vertical (select this if Google Merchant is not available for your country)' ); ?>
380
+ </div>
381
+ </div>
382
+ <div class="col-1">
383
+ <?php renderPopoverButton( 'google_dynamic_remarketing_vertical' ); ?>
384
+ </div>
385
+ </div>
386
+ </div>
387
+ </div>
388
+
389
+
390
+
391
  <!-- Event Value -->
392
  <div class="card card-static card-disabled">
393
  <div class="card-header">
448
  <?php if ( Pinterest()->enabled() ) : ?>
449
  <div class="row">
450
  <div class="col">
451
+ <?php Pinterest()->render_switcher_input( 'woo_checkout_enabled' ); ?>
452
  <h4 class="switcher-label">Enable the Checkout event on Pinterest</h4>
453
  <?php Pinterest()->renderAddonNotice(); ?>
454
  </div>
801
  <?php if ( Pinterest()->enabled() ) : ?>
802
  <div class="row">
803
  <div class="col">
804
+ <?php Pinterest()->render_switcher_input( 'woo_page_visit_enabled' ); ?>
805
  <h4 class="switcher-label">Enable the PageVisit event on Pinterest</h4>
806
  <?php Pinterest()->renderAddonNotice(); ?>
807
  </div>
modules/bing/bing.php CHANGED
@@ -25,7 +25,7 @@ class Bing extends Settings implements Pixel {
25
  }
26
 
27
  public function enabled() {
28
- return true;
29
  }
30
 
31
  public function configured() {
25
  }
26
 
27
  public function enabled() {
28
+ return false;
29
  }
30
 
31
  public function configured() {
modules/google_analytics/function-helpers.php CHANGED
@@ -33,4 +33,50 @@ function renderCrossDomainDomain( $index = 0 ) {
33
 
34
  <?php
35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  }
33
 
34
  <?php
35
 
36
+ }
37
+
38
+ function getWooProductContentId( $product_id ) {
39
+
40
+ if ( PixelYourSite\GA()->getOption( 'woo_content_id' ) == 'product_sku' ) {
41
+ $content_id = get_post_meta( $product_id, '_sku', true );
42
+ } else {
43
+ $content_id = $product_id;
44
+ }
45
+
46
+ $prefix = PixelYourSite\GA()->getOption( 'woo_content_id_prefix' );
47
+ $suffix = PixelYourSite\GA()->getOption( 'woo_content_id_suffix' );
48
+
49
+ $value = $prefix . $content_id . $suffix;
50
+
51
+ return $value;
52
+ }
53
+
54
+ function getWooCartItemId( $item ) {
55
+
56
+ if ( ! PixelYourSite\GA()->getOption( 'woo_variable_as_simple' ) && isset( $item['variation_id'] ) && $item['variation_id'] !== 0 ) {
57
+ $product_id = $item['variation_id'];
58
+ } else {
59
+ $product_id = $item['product_id'];
60
+ }
61
+
62
+ return $product_id;
63
+ }
64
+
65
+ /*
66
+ * EASY DIGITAL DOWNLOADS
67
+ */
68
+
69
+ function getEddDownloadContentId( $download_id )
70
+ {
71
+
72
+ if (PixelYourSite\GA()->getOption('edd_content_id') == 'download_sku') {
73
+ $content_id = get_post_meta($download_id, 'edd_sku', true);
74
+ } else {
75
+ $content_id = $download_id;
76
+ }
77
+
78
+ $prefix = PixelYourSite\GA()->getOption('edd_content_id_prefix');
79
+ $suffix = PixelYourSite\GA()->getOption('edd_content_id_suffix');
80
+
81
+ return $prefix . $content_id . $suffix;
82
  }
modules/google_analytics/ga.php CHANGED
@@ -315,7 +315,7 @@ class GA extends Settings implements Pixel {
315
  }
316
 
317
  $item = array(
318
- 'id' => $posts[ $i ]->ID,
319
  'name' => $posts[ $i ]->post_title,
320
  'category' => implode( '/', getObjectTerms( 'product_cat', $posts[ $i ]->ID ) ),
321
  'quantity' => 1,
@@ -355,7 +355,7 @@ class GA extends Settings implements Pixel {
355
  'event_category' => 'ecommerce',
356
  'items' => array(
357
  array(
358
- 'id' => $post->ID,
359
  'name' => $post->post_title,
360
  'category' => implode( '/', getObjectTerms( 'product_cat', $post->ID ) ),
361
  'quantity' => 1,
@@ -378,7 +378,7 @@ class GA extends Settings implements Pixel {
378
  if ( ! $this->getOption( 'woo_add_to_cart_enabled' ) || ! PYS()->getOption( 'woo_add_to_cart_on_button_click' ) ) {
379
  return false;
380
  }
381
-
382
  $product = get_post( $product_id );
383
  $price = getWooProductPriceToDisplay( $product_id, 1 );
384
 
@@ -386,7 +386,7 @@ class GA extends Settings implements Pixel {
386
  'event_category' => 'ecommerce',
387
  'items' => array(
388
  array(
389
- 'id' => $product_id,
390
  'name' => $product->post_title,
391
  'category' => implode( '/', getObjectTerms( 'product_cat', $product_id ) ),
392
  'quantity' => 1,
@@ -486,8 +486,11 @@ class GA extends Settings implements Pixel {
486
 
487
  foreach ( $order->get_items( 'line_item' ) as $line_item ) {
488
 
489
- $post = get_post( $line_item['product_id'] );
490
- $product = wc_get_product( $line_item['product_id'] );
 
 
 
491
 
492
  if ( $line_item['variation_id'] ) {
493
  $variation = get_post( $line_item['variation_id'] );
@@ -528,9 +531,9 @@ class GA extends Settings implements Pixel {
528
  }
529
 
530
  $item = array(
531
- 'id' => $post->ID,
532
  'name' => $post->post_title,
533
- 'category' => implode( '/', getObjectTerms( 'product_cat', $post->ID ) ),
534
  'quantity' => $qty,
535
  'price' => $price,
536
  'variant' => $variation_name,
@@ -538,7 +541,7 @@ class GA extends Settings implements Pixel {
538
 
539
  $items[] = $item;
540
  $product_ids[] = $item['id'];
541
- $total_value += $item['price'];
542
 
543
  }
544
 
@@ -566,7 +569,10 @@ class GA extends Settings implements Pixel {
566
 
567
  foreach ( WC()->cart->cart_contents as $cart_item_key => $cart_item ) {
568
 
569
- $product = get_post( $cart_item['product_id'] );
 
 
 
570
 
571
  if ( $cart_item['variation_id'] ) {
572
  $variation = get_post( $cart_item['variation_id'] );
@@ -576,11 +582,11 @@ class GA extends Settings implements Pixel {
576
  }
577
 
578
  $item = array(
579
- 'id' => $product->ID,
580
  'name' => $product->post_title,
581
- 'category' => implode( '/', getObjectTerms( 'product_cat', $product->ID ) ),
582
  'quantity' => $cart_item['quantity'],
583
- 'price' => getWooProductPriceToDisplay( $product->ID ),
584
  'variant' => $variation_name,
585
  );
586
 
@@ -647,7 +653,7 @@ class GA extends Settings implements Pixel {
647
  'event_category' => 'ecommerce',
648
  'items' => array(
649
  array(
650
- 'id' => $download_id,
651
  'name' => $download_post->post_title,
652
  'category' => implode( '/', getObjectTerms( 'download_category', $download_id ) ),
653
  'quantity' => 1,
@@ -718,7 +724,7 @@ class GA extends Settings implements Pixel {
718
  }
719
 
720
  $item = array(
721
- 'id' => $download_id,
722
  'name' => $download_post->post_title,
723
  'category' => implode( '/', getObjectTerms( 'download_category', $download_id ) ),
724
  'quantity' => $cart_item['quantity'],
@@ -780,7 +786,7 @@ class GA extends Settings implements Pixel {
780
  'currency' => edd_get_currency(),
781
  'items' => array(
782
  array(
783
- 'id' => $download_id,
784
  'name' => $download_post->post_title,
785
  'category' => implode( '/', getObjectTerms( 'download_category', $download_id ) ),
786
  'quantity' => $cart_item['quantity'],
@@ -821,7 +827,7 @@ class GA extends Settings implements Pixel {
821
  for ( $i = 0; $i < count( $posts ); $i ++ ) {
822
 
823
  $item = array(
824
- 'id' => $posts[ $i ]->ID,
825
  'name' => $posts[ $i ]->post_title,
826
  'category' => implode( '/', getObjectTerms( 'download_category', $posts[ $i ]->ID ) ),
827
  'quantity' => 1,
315
  }
316
 
317
  $item = array(
318
+ 'id' => GA\Helpers\getWooProductContentId($posts[ $i ]->ID),
319
  'name' => $posts[ $i ]->post_title,
320
  'category' => implode( '/', getObjectTerms( 'product_cat', $posts[ $i ]->ID ) ),
321
  'quantity' => 1,
355
  'event_category' => 'ecommerce',
356
  'items' => array(
357
  array(
358
+ 'id' => GA\Helpers\getWooProductContentId($post->ID),
359
  'name' => $post->post_title,
360
  'category' => implode( '/', getObjectTerms( 'product_cat', $post->ID ) ),
361
  'quantity' => 1,
378
  if ( ! $this->getOption( 'woo_add_to_cart_enabled' ) || ! PYS()->getOption( 'woo_add_to_cart_on_button_click' ) ) {
379
  return false;
380
  }
381
+ $content_id = GA\Helpers\getWooProductContentId($product_id);
382
  $product = get_post( $product_id );
383
  $price = getWooProductPriceToDisplay( $product_id, 1 );
384
 
386
  'event_category' => 'ecommerce',
387
  'items' => array(
388
  array(
389
+ 'id' => $content_id,
390
  'name' => $product->post_title,
391
  'category' => implode( '/', getObjectTerms( 'product_cat', $product_id ) ),
392
  'quantity' => 1,
486
 
487
  foreach ( $order->get_items( 'line_item' ) as $line_item ) {
488
 
489
+ $product_id = GA\Helpers\getWooCartItemId( $line_item );
490
+ $content_id = GA\Helpers\getWooProductContentId( $product_id );
491
+
492
+ $post = get_post( $product_id );
493
+ $product = wc_get_product( $product_id );
494
 
495
  if ( $line_item['variation_id'] ) {
496
  $variation = get_post( $line_item['variation_id'] );
531
  }
532
 
533
  $item = array(
534
+ 'id' => $content_id,
535
  'name' => $post->post_title,
536
+ 'category' => implode( '/', getObjectTerms( 'product_cat', $product_id ) ),
537
  'quantity' => $qty,
538
  'price' => $price,
539
  'variant' => $variation_name,
541
 
542
  $items[] = $item;
543
  $product_ids[] = $item['id'];
544
+ $total_value += $item['price' ];
545
 
546
  }
547
 
569
 
570
  foreach ( WC()->cart->cart_contents as $cart_item_key => $cart_item ) {
571
 
572
+ $product_id = GA\Helpers\getWooCartItemId( $cart_item );
573
+ $content_id = GA\Helpers\getWooProductContentId( $product_id );
574
+
575
+ $product = get_post( $product_id );
576
 
577
  if ( $cart_item['variation_id'] ) {
578
  $variation = get_post( $cart_item['variation_id'] );
582
  }
583
 
584
  $item = array(
585
+ 'id' => $content_id,
586
  'name' => $product->post_title,
587
+ 'category' => implode( '/', getObjectTerms( 'product_cat', $product_id ) ),
588
  'quantity' => $cart_item['quantity'],
589
+ 'price' => getWooProductPriceToDisplay( $product_id ),
590
  'variant' => $variation_name,
591
  );
592
 
653
  'event_category' => 'ecommerce',
654
  'items' => array(
655
  array(
656
+ 'id' => GA\Helpers\getEddDownloadContentId($download_id),
657
  'name' => $download_post->post_title,
658
  'category' => implode( '/', getObjectTerms( 'download_category', $download_id ) ),
659
  'quantity' => 1,
724
  }
725
 
726
  $item = array(
727
+ 'id' => GA\Helpers\getEddDownloadContentId($download_id),
728
  'name' => $download_post->post_title,
729
  'category' => implode( '/', getObjectTerms( 'download_category', $download_id ) ),
730
  'quantity' => $cart_item['quantity'],
786
  'currency' => edd_get_currency(),
787
  'items' => array(
788
  array(
789
+ 'id' => GA\Helpers\getEddDownloadContentId($download_id),
790
  'name' => $download_post->post_title,
791
  'category' => implode( '/', getObjectTerms( 'download_category', $download_id ) ),
792
  'quantity' => $cart_item['quantity'],
827
  for ( $i = 0; $i < count( $posts ); $i ++ ) {
828
 
829
  $item = array(
830
+ 'id' => GA\Helpers\getEddDownloadContentId($posts[ $i ]->ID),
831
  'name' => $posts[ $i ]->post_title,
832
  'category' => implode( '/', getObjectTerms( 'download_category', $posts[ $i ]->ID ) ),
833
  'quantity' => 1,
modules/google_analytics/options_defaults.json CHANGED
@@ -17,6 +17,11 @@
17
  "form_event_enabled": true,
18
  "form_event_non_interactive": false,
19
 
 
 
 
 
 
20
  "woo_purchase_enabled": true,
21
  "woo_purchase_non_interactive": true,
22
  "woo_initiate_checkout_enabled": true,
@@ -30,6 +35,10 @@
30
  "woo_view_category_enabled": true,
31
  "woo_view_category_non_interactive": true,
32
 
 
 
 
 
33
  "edd_purchase_enabled": true,
34
  "edd_purchase_non_interactive": true,
35
  "edd_initiate_checkout_enabled": true,
17
  "form_event_enabled": true,
18
  "form_event_non_interactive": false,
19
 
20
+ "woo_variable_as_simple": false,
21
+ "woo_content_id": "product_id",
22
+ "woo_content_id_prefix": "",
23
+ "woo_content_id_suffix": "",
24
+
25
  "woo_purchase_enabled": true,
26
  "woo_purchase_non_interactive": true,
27
  "woo_initiate_checkout_enabled": true,
35
  "woo_view_category_enabled": true,
36
  "woo_view_category_non_interactive": true,
37
 
38
+ "edd_content_id": "download_id",
39
+ "edd_content_id_prefix": "",
40
+ "edd_content_id_suffix": "",
41
+
42
  "edd_purchase_enabled": true,
43
  "edd_purchase_non_interactive": true,
44
  "edd_initiate_checkout_enabled": true,
modules/google_analytics/options_fields.json CHANGED
@@ -17,6 +17,11 @@
17
  "form_event_enabled": "checkbox",
18
  "form_event_non_interactive": "checkbox",
19
 
 
 
 
 
 
20
  "woo_purchase_enabled": "checkbox",
21
  "woo_purchase_non_interactive": "checkbox",
22
  "woo_initiate_checkout_enabled": "checkbox",
@@ -30,6 +35,10 @@
30
  "woo_view_category_enabled": "checkbox",
31
  "woo_view_category_non_interactive": "checkbox",
32
 
 
 
 
 
33
  "edd_purchase_enabled": "checkbox",
34
  "edd_purchase_non_interactive": "checkbox",
35
  "edd_initiate_checkout_enabled": "checkbox",
17
  "form_event_enabled": "checkbox",
18
  "form_event_non_interactive": "checkbox",
19
 
20
+ "woo_variable_as_simple": "checkbox",
21
+ "woo_content_id": "select",
22
+ "woo_content_id_prefix": "text",
23
+ "woo_content_id_suffix": "text",
24
+
25
  "woo_purchase_enabled": "checkbox",
26
  "woo_purchase_non_interactive": "checkbox",
27
  "woo_initiate_checkout_enabled": "checkbox",
35
  "woo_view_category_enabled": "checkbox",
36
  "woo_view_category_non_interactive": "checkbox",
37
 
38
+ "edd_content_id": "select",
39
+ "edd_content_id_prefix": "text",
40
+ "edd_content_id_suffix": "text",
41
+
42
  "edd_purchase_enabled": "checkbox",
43
  "edd_purchase_non_interactive": "checkbox",
44
  "edd_initiate_checkout_enabled": "checkbox",
modules/pinterest/pinterest.php CHANGED
@@ -29,7 +29,7 @@ class Pinterest extends Settings implements Pixel {
29
  }
30
 
31
  public function enabled() {
32
- return true;
33
  }
34
 
35
  public function configured() {
29
  }
30
 
31
  public function enabled() {
32
+ return false;
33
  }
34
 
35
  public function configured() {
pixelyoursite.php CHANGED
@@ -4,7 +4,7 @@ if ( ! defined( 'ABSPATH' ) ) {
4
  exit; // Exit if accessed directly.
5
  }
6
 
7
- define( 'PYS_FREE_VERSION', '7.1.2' );
8
  define( 'PYS_FREE_PINTEREST_MIN_VERSION', '2.0.6' );
9
  define( 'PYS_FREE_BING_MIN_VERSION', '1.0.0' );
10
  define( 'PYS_FREE_PATH', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
4
  exit; // Exit if accessed directly.
5
  }
6
 
7
+ define( 'PYS_FREE_VERSION', '7.1.3' );
8
  define( 'PYS_FREE_PINTEREST_MIN_VERSION', '2.0.6' );
9
  define( 'PYS_FREE_BING_MIN_VERSION', '1.0.0' );
10
  define( 'PYS_FREE_PATH', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: Facebook Pixel, New Facebook Pixel, Facebook Conversion Pixel, Facebook Pi
4
  Requires at least: 3.0.1
5
  Requires PHP: 5.4
6
  Tested up to: 5.2
7
- Stable tag: 7.1.2
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -388,6 +388,16 @@ NO, absolutely not! We don't track any type of data about your website. We simpl
388
 
389
  == Changelog ==
390
 
 
 
 
 
 
 
 
 
 
 
391
 
392
  = PixelYourSite 7.1.2 =
393
 
4
  Requires at least: 3.0.1
5
  Requires PHP: 5.4
6
  Tested up to: 5.2
7
+ Stable tag: 7.1.3
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
388
 
389
  == Changelog ==
390
 
391
+ = PixelYourSite 7.1.3 =
392
+
393
+ * Adding new options for WooCommerce and EDD events IDs: select between ID or SKU, use prefixes and postfixes, treat variable products like simple products. These features will work with the Pinterest add-on v2.0.8 (free), and the Bing add-on v1.0.2 (paid).
394
+
395
+ * Fix for an old bug related to how On Page Events triggers work. In previous versions, final slashes were ignored for both “URL Match” and “URL Contains” conditions. This was fixed with this release.
396
+ Recommendation: if you have manually added events using the On-Page trigger, test them to make sure they work as expected.
397
+
398
+ * Fix for a bug related to the Pinterest add-on. In previous versions, the WooCommerce Checkout and PageVisit events could not be turned ON/OFF.
399
+
400
+
401
 
402
  = PixelYourSite 7.1.2 =
403