Last active
August 29, 2015 14:13
-
-
Save digdeep/5effd8ccad780161d40d to your computer and use it in GitHub Desktop.
maichimp javascript get user id
This file contains 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
<script type="text/javascript"> | |
if(window.location.href.indexOf("&mc_cid")) { | |
var a_mc_cid = location.search.split('&')[7]; | |
var b_mc_cid = a_mc_cid.split('=')[1]; | |
var a_mc_eid = location.search.split('&')[8]; | |
var b_mc_eid = a_mc_eid.split('=')[1]; | |
dataLayer.push ({ 'event': 'mailchimp', 'eventCategory': b_mc_cid, 'eventAction': b_mc_eid, 'eventLabel': '{{WPeventId}}', 'nonInteraction': 1 }); | |
}; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment