Skip to content

Instantly share code, notes, and snippets.

@yieldmo
Forked from emaxerrno/shinji.adv.sample.postback.js
Last active August 29, 2015 13:55
Show Gist options
  • Save yieldmo/8700796 to your computer and use it in GitHub Desktop.
Save yieldmo/8700796 to your computer and use it in GitHub Desktop.
var addScriptTag = function(url) {
var node = document.createElement('script');
node.type = 'text/javascript';
node.async = true;
node.src = ('https:' === document.location.protocol ? 'https:' : 'http:') + url;
node.id = '' + new Date().getTime();
var topelem = (document.getElementsByTagName('head')[0] ||
document.getElementsByTagName('body')[0]);
topelem.appendChild(node);
};
// you need to extract {{click_id}} out of the url
// refer to ym_submit_with_click_id.js (https://gist.github.com/yieldmo/8700590)
var clickId = '22222';
addScript('//tkr.yieldmo.com/t_adt/adt?click_id' + clickId);
@blim8183
Copy link

Should line 15 actually be:

addScriptTag('//tkr.yieldmo.com/t_adt/adt?click_id' + clickId);

?

@inkredabull
Copy link

I think there's an '=' missing after the click_id param in both examples; should be:
addScript('//tkr.yieldmo.com/t_adt/adt?click_id=' + clickId);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment