nican VIP
Total posts: 392
30 Dec 2015 14:05

Hello, I am not sure how to insert the Adwords conversion code

<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 1060129671;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "EPy2CPX57GIQh5fB-QM";
var google_remarketing_only = false;
/* ]]> */
</script>
<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/1060129671/?label=EPy2CPX57GIQh5fB-QM&amp;guid=ON&amp;script=0"/>
</div>
</noscript>

In Emerald Custom Javascript action, where I should insert the code I see the message Javascript codeWithout <script> tag!

As you see the code above has 2 script tag, 1 noscript tag and 1 div tag How should I insert it?

Thank you

Last Modified: 15 Mar 2016


Sergey
Total posts: 13,748
30 Dec 2015 16:57
var google_conversion_id = 1060129671;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "EPy2CPX57GIQh5fB-QM";
var google_remarketing_only = false;

document.write("<script type='text/javascript' src='//www.googleadservices.com/pagead/conversion.js'></script>");

var img = document.createElement("img");
img.src = '//www.googleadservices.com/pagead/conversion/1060129671/?label=EPy2CPX57GIQh5fB-QM&amp;guid=ON&amp;script=0';
img.style.visibility = "none";

document.body.appendChild(img);

Something like this. I did not test but it should work.


nican VIP
Total posts: 392
30 Dec 2015 17:35

Sorry, it's not working, the "Add" button under the action field is not clickable if I paste the whole code.

The button only works (and the action is bein saved) if I paste only this part of the code

var google_conversion_id = 1060129671;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "EPy2CPX57GIQh5fB-QM";
var google_remarketing_only = false;

Sergey
Total posts: 13,748
05 Jan 2016 07:00

What error do you ahve in console? It does work for me.


nican VIP
Total posts: 392
10 Mar 2016 12:48

I just used a workaround, for this kind of conversion analytics is probably easier to just redirect to a thank you page after purchase and insert there any code I need.

Thanks anyway


Sergey
Total posts: 13,748
14 Mar 2016 02:27

Not always. Actions is build the way to make sure it is triggered. I mean when it is action you are sure it will be triggered at least once. And there is only one success return after purchase. If something happens in bettween like user close window, brown out, error on the site, etc... Then you have no redirection.


Sergey
Total posts: 13,748
14 Mar 2016 02:28

What I can do is the redirect action that will redirect user to indicated URL after purchase.


nican VIP
Total posts: 392
14 Mar 2016 13:08

Sergey What I can do is the redirect action that will redirect user to indicated URL after purchase.

I thought this was already done, I see the option to redirect to a "success page" and to a "failure page" in the subscription settings, and this what I am using to redirect users to a certain page.

If you do this through an Action, but the user close the browser window after payment etc... thsi would casue the same problems as the redirect I am using now, wouldn't it?

Thank you


Sergey
Total posts: 13,748
15 Mar 2016 13:46

nican I thought this was already done, I see the option to redirect to a "success page" and to a "failure page" in the subscription settings, and this what I am using to redirect users to a certain page.

This is not an action. This is plan rules. They may fail to work on the reasons I had described earlier.

nican If you do this through an Action, but the user close the browser window after payment etc... thsi would casue the same problems as the redirect I am using now, wouldn't it?

Actions have a flag. They wount stop trying to do what they should untill action is registered as triggered.

Powered by Cobalt