Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Conversion Tracking with Variables

benedicth377655
Level 1
Level 1

Hello,

I want to integrate a Tracking Pixel with variables:

<iframe src="https://tbs.tradedoubler.com/report?organization=7362551&event=917835654&orderNumber=[VARIABLE]&orde..." height="1" width="1" border="0"/>

The variables [VARIABLE], [Transaction_value] and [Currency] are still on my site in the data layer:

[variable] = _satellite.getVar("transactionID")

[Transaction_value] = _satellite.getVar("transactionRevenue")

[Currency] = _satellite.getVar("transactionCurrency")

1. How can I get this data layer veariables in the Conversion Code?

2. What implementation method should I use in the rule (sequentiell HTML, sequentiell java, not sequentiell)?

Many thanks!

1 Accepted Solution
jantzen_belliston-Adobe
Correct answer by
Level 10
Level 10

Hi,

The pixel you provided is an HTML iframe. By default, that tag does not support dynamic variables. In order to dynamically populate a variable, you will need to use some sort of script to populate the URL. Below is one way you can accomplish this, but you can find others by doing a quick search for "dynamically populating iframe src".

In this case, you'd deploy an <iframe> tag, preferably with a unique id. Then you'd deploy a version of the script below where you populate the url that will then be dynamically injected into the iframe. In the script below, you should be able to use  _satellite_getVar() to retrieve the value of DTM data elements.

window.onload = function() { var url; //You can get this url dynamically from an ajax request or from a form etc 

// To Do : A function to populate url with a valid url from any method you prefer. 

// Set an ID for the iframe. Let us give that an id of myframe

document.getElementById("myframe").setAttribute("src", url); }

View solution in original post

1 Reply
jantzen_belliston-Adobe
Correct answer by
Level 10
Level 10

Hi,

The pixel you provided is an HTML iframe. By default, that tag does not support dynamic variables. In order to dynamically populate a variable, you will need to use some sort of script to populate the URL. Below is one way you can accomplish this, but you can find others by doing a quick search for "dynamically populating iframe src".

In this case, you'd deploy an <iframe> tag, preferably with a unique id. Then you'd deploy a version of the script below where you populate the url that will then be dynamically injected into the iframe. In the script below, you should be able to use  _satellite_getVar() to retrieve the value of DTM data elements.

window.onload = function() { var url; //You can get this url dynamically from an ajax request or from a form etc 

// To Do : A function to populate url with a valid url from any method you prefer. 

// Set an ID for the iframe. Let us give that an id of myframe

document.getElementById("myframe").setAttribute("src", url); }

View solution in original post