Forked from dpaternina9/mi-outbound-amazon-apple-affiliate.php
Created
May 15, 2023 15:56
-
-
Save bhubbard/d414214ac54aecc04b43717b8bff68bc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function monsterinsights_amz_appl_affiliate_links() { | |
?> | |
<script> | |
jQuery( document ).ready(function() { | |
jQuery('a[href*="amazon.com"],a[href*="amzn.to"],a[href*="tv.apple"]').each(function() { | |
jQuery(this).attr('data-vars-ga-category', 'outbound-link-affiliate' ); | |
}); | |
}); | |
</script> | |
<?php | |
} | |
add_action('wp_head', 'monsterinsights_amz_appl_affiliate_links'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment