Skip to content

Instantly share code, notes, and snippets.

@kmclaugh
kmclaugh / taxonomyTrackerTemplate.tpl
Last active August 22, 2019 11:42
Track taxonomies like categories and tags in Google Analytics with this Google Tag Manager custom template
___INFO___
{
"displayName": "Taxonomy Tracker",
"description": "Fires a datalayer event for each element in the given taxonomy array",
"securityGroups": [],
"id": "cvt_temp_public_id",
"type": "TAG",
"version": 1,
"brand": {
@irazasyed
irazasyed / hide_email.php
Created September 19, 2013 09:53
PHP: Hide Email - To hide email in php, outputs obfuscated JS code.
<?php
/*
To hide email in PHP, Outputs Obfuscated JS code.
Source: http://www.maurits.vdschee.nl/php_hide_email/
*/
function hide_email($email) {
$character_set = '+-.0123456789@ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz';
$key = str_shuffle($character_set); $cipher_text = ''; $id = 'e'.rand(1,999999999);
for ($i=0;$i<strlen($email);$i+=1) $cipher_text.= $key[strpos($character_set,$email[$i])];
$script = 'var a="'.$key.'";var b=a.split("").sort().join("");var c="'.$cipher_text.'";var d="";';