- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
06-13-2017 06:27 AM
Hi,
I am trying to map a variable called ranMID to a static value in Rakuten Marketing Tag. ranMID is not defined in the Tealium template and so I created a custom destination called ranMID and mapped it to another variable containing the static value I want. This data is not showing up however. As per https://community.tealiumiq.com/t5/iQ-Tag-Management/Adding-a-User-Defined-Destination-Mapping-to-a-... some tags do not accept custom destinations. If this tag is among them, can you pleaseenable it here. Or add ranMID as a pre-existing destination that we can map our value to. I have a lot of Rakuten tags to add, so will be very grateful if you can do either of these things.
Thanks a lot!
Sujani
Solved! Go to Solution.
06-15-2017 11:05 AM - last edited on 06-15-2017 11:49 AM by kathleen_jo
Hi @sujani_koya,
Do you have any documentation from Rakuten Marketing that shows how additional custom parameters should be passed?
The documentation we used to build the integration didn't specify this.
Thanks,
Adam
06-16-2017 08:06 AM - last edited on 06-16-2017 09:51 AM by kathleen_jo
Hi @adam_wolfers,
Here is the code I have. Thank you for responding.
Sujani
<!-- START of Rakuten Marketing Conversion Tag -->
<script type="text/javascript">
var rm_trans = {
orderid : 'ORDERID', order_id
currency: 'CURRENCYCODE', order_currency
customerStatus: 'CUSTOMER_STATUS', //new or existing
conversionType: 'Sale',
customerID: 'CUSTOMER_ID', // optional
discountCode: 'DISCOUNT_CODE', offer_id
discountAmount: DISCOUNT_AMOUNT, local_order_discount_amount
taxAmount: TAX_AMOUNT, local_order_tax_amount
ranMID: '42657',
lineitems : [{
quantity : QUANTITY_PURCHASED, product_quantity
unitPrice : SINGLE_UNIT_ITEM_PRICE,
unitPriceLessTax: SINGLE_UNIT_ITEM_PRICE_NO_TAX,
SKU: '42657',
productName: 'PRODUCT_NAME'
}]
};
/*Do not edit any information beneath this line*/
if(!window.DataLayer){window.DataLayer={Sale:{Basket:rm_trans}}}else{DataLayer.Sale=DataLayer.Sale||{Basket:rm_trans};DataLayer.Sale.Basket=DataLayer.Sale.Basket||rm_trans}DataLayer.Sale.Basket.Ready = true;
function sRAN(){var a="p",b=1,c="p",d=0,e=0,f=DataLayer&&DataLayer.Sale&&DataLayer.Sale.Basket?DataLayer.Sale.Basket:{},g=f.affiliateMID||f.ranMID;if(!g)return!1;var h=f.allowCommission;if(h&&"false"==h.toLowerCase())return!1;var i=f.orderid||"OrderNumberNotAvailable",j="",k="",l="",m="",n=f.currency||"",o="o"===c,p=f.taxAmount?Math.abs(Math.round(100*Number(f.taxAmount))):0,q=f.discountAmount?Math.abs(Math.round(100*Number(f.discountAmount))):0,r="p"===a?"ep":"m"===a?"eventnvppixel":"",s=f.customerStatus||"",t="",u=document.location.protocol+"//track.linksynergy.com/"+r+"?",v="";null!=s&&""!=s&&(e&&"EXISTING"==s.toUpperCase()||e&&"RETURNING"==s.toUpperCase())&&(v="R_"),d&&"MOBILE"==t.toUpperCase()&&"R_"==v&&(v="MR_"),d&&"MOBILE"==t.toUpperCase()&&""==v&&(v="M_");for(var w=[],x=0;x<(f.lineitems?f.lineitems.length:0);x++){for(var y=!1,z=window.JSON?JSON.parse(JSON.stringify(f.lineitems[x])):f.lineitems[x],A=0;A<w.length;A++){w[A].SKU===z.SKU&&(y=!0,w[A].quantity=Number(w[A].quantity)+Number(z.quantity))}y||w.push(z)}for(var x=0;x<w.length;x++){var z=w[x],C=encodeURIComponent(z.SKU),D=z.unitPriceLessTax||z.unitPrice,E=z.quantity,F=encodeURIComponent(z.productName)||"";j+=v+C+"|",k+=E+"|",l+=Math.round(Number(D)*Number(E)*100)+"|",m+=v+F+"|"}j=j.slice(0,-1),k=k.slice(0,-1),l=l.slice(0,-1),m=m.slice(0,-1),q&&b&&(j+="|"+v+"DISCOUNT",m+="|"+v+"DISCOUNT",k+="|0",l+="|-"+q),o&&p&&(j+="|"+v+"ORDERTAX",k+="|0",l+="|-"+p,m+="|"+v+"ORDERTAX"),u+="mid="+g+"&ord="+i+"&skulist="+j+"&qlist="+k+"&amtlist="+l+"&cur="+n+"&namelist="+m+"&img=1";var G,H=document.createElement("img");H.setAttribute("src",u),H.setAttribute("height","1px"),H.setAttribute("width","1px"),G=document.getElementsByTagName("script")[0],G.parentNode.insertBefore(H,G)}sRAN();
</script>
<!-- END of Rakuten Marketing Conversion Tag -->
06-16-2017 12:26 PM
Hi @adam_wolfers there is another tag called Rakuten Marketing Tracking tag. The one posted above is Rakuten Marketing Conversion tag. The code for the Rakuten Marketing Tracking tag which fires perfectly using the Tealium template, is as follows:
<!-- START Rakuten Marketing Tracking -->
<script type="text/javascript">
(function (url) {
/*Tracking Bootstrap
Set Up DataLayer objects/properties here*/
if(!window.DataLayer){
window.DataLayer = {};
}
if(!DataLayer.events){
DataLayer.events = {};
}
DataLayer.events.SiteSection = "1";
var loc, ct = document.createElement("script");
ct.type = "text/javascript";
ct.async = true;
ct.src=url;
loc = document.getElementsByTagName('script')[0];
loc.parentNode.insertBefore(ct, loc);
}(document.location.protocol + "//intljs.rmtag.com/113794.ct.js"));
</script>
<!-- END Rakuten Marketing Tracking -->
06-16-2017 07:04 PM
Can you please let me know if it is possible to add this custom destination (ranMID) to the template. Else, is there another way to add this? Should I add the code as a Tealium Generic tag and all the code in an extension? Please give me some ideas. Thank you!
06-19-2017 09:26 AM
Hi @sujani_koya. My apologies. Adam is on vacation right now. He should be back tomorrow to answer your questions or I can find someone else to help if you cannot wait. Let me know!
06-19-2017 10:01 AM
Hi Kathleen!
Chris Horne has been responding to my request. Thanks a lot! I will close this question once that is fully solved.
Regards,
Sujani
06-19-2017 10:29 AM
Sounds good @sujani_koya. If you feel up to it, would you mind posting your solution here once you receive it!? I'm curious to know. :-)
06-20-2017 11:29 PM
Hi!
These are the changes done.
1. In the template, in the definition of utag.data, this line is added
"ranMID" : ""
2. In the tag template again, in the if condition => if ( u.data.order_id ) { , this line has been added
g.ranMID = u.data.ranMID || b.ranmidvariable || "";
where I've defined a utag js variable called ranmidvariable in the data layer. Used an extension to assign a static value to it. In the mapping in the tag configuration, I've created a custom destination called ranMID to which I've mapped the ranmidvariable.
Thank you,
Sujani
06-21-2017 10:50 AM
Outstanding @sujani_koya! Thank you so much for sharing.
08-22-2017 05:25 AM
Hi
Could we actually get Tealium to update the tag to match this, as i am here specifcally beacuse the templates dont match what i have been sent.
08-22-2017 08:12 AM
Hi @johnmitchell. Perhaps @adam_wolfers can help? Or maybe @chris_horne?
08-24-2017 03:48 PM
Hey @johnmitchell,
Does the code posted by @sujani_koya on June 16th match what you were sent, and you're looking for the tag template to support the "ranMID" parameter? If so, what would be a good label for this parameter?
Do you need support for any other parameters?
Thanks,
Adam
08-25-2017 02:30 AM
Hope you are well, i have attached the instructions that Rakuten/Linkshare sent over to me in a google drive link
With all the ecommerce data that needs mapping and user information, the linkshare tags have two IDs
In tealium the code is (as mentioned initially by @sujani_koya) wrong and missing these elements.
Cheers
Dev guide
https://drive.google.com/file/d/0B_5vJyzwazLLbzIyZjNjMUVVZEk/view?usp=sharing
Tag Examples
https://drive.google.com/file/d/0B_5vJyzwazLLb25KN2NxYUlxdjA/view?usp=sharing
https://drive.google.com/file/d/0B_5vJyzwazLLTl9hVk02a1NHRHc/view?usp=sharing
Copyright All Rights Reserved © 2008-2023