AdWords
1.7K members online now
1.7K members online now
Dive into advanced features like Remarketing, Flexible Bid Strategies, AdWords Editor, and AdWords Scripts
Guide Me
star_border
Reply

Insert google adword tracking code while partial postback from ASP.NET

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi All,

I am facing an issue these days to execute Google Adwords tracking code during partial post back from ASP.NET.
Here below is the sample google tracking code which I want to be executed:

<!-- Google Code for execution -->
    <script type="text/javascript">
        /* <![CDATA[ */
        var google_conversion_id = xxxxx;
        var google_conversion_language = "en";
        var google_conversion_format = "3";
        var google_conversion_color = "ffffff";
        var google_conversion_label = "xxxxxxx";
        var google_conversion_value = 0;
        /* ]]> */
    </script>
    <script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js">
    </script>
    <noscript>
        <div style="display: inline;">
            <img height="1" width="1" style="border-style: none;" alt="" src="http://www.googleadservices.com/pagead/conversion/xxxxxxxx/?value=0&amp;label=xxxxxxxx&amp;guid=ON&a..." />
        </div>
    </noscript>


Now the ScriptManager code through which I want this to be executed is :

ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "ScriptName", script, false);


Now it does not allow me to do following two things:
1. Won't allow me to add HTML style comments section like <!-- -->
2. The NoScript area is not permitted.

Can somebody help me how to get it through, may be not through ScriptManager and some other way.
Note: Doing full postback is not an option for me.

Thanks in advance
Amit Arora

2 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by rashu (Google Employee)
September 2015

Re: Insert google adword tracking code while partial postback from ASP.NET

Google Employee
# 3
Google Employee

Hi FISIndiaPruhaw, 

 

Here are my thoughts on your two notes --

 

1) adding the HTML style comments section will not affect how the Google AdWords conversion tracking code executes, so this should not be preventing anything from happening with the conversion tracking code itself. 

 

2) the <noscript> section is for visitors who come to your website that do not have javascript enabled - this is typically a very small portion of your website traffic, if anything at all. As a reminder, this part of the conversion tracking code will only execute if someone has come to your website and they do not have javascript enabled. 

 

I would also recommend again the help center article that pankaj1782 mentioned. I hope this helps!

 

Sincerely,

Tiffany

View solution in original post

Re: Insert google adword tracking code while partial postback from ASP.NET

Top Contributor
# 2
Top Contributor

Hello Amit,

 

Welcome to the forum Smiley Happy

 

Honestly, I am not a tech savvy, but I hope that implementation of conversion tracking for ASP pages explained here, might give a little hint of what you are missing.

 

And I hope any technical experts can share a bit of their knowledge with you for better understanding.

 

My apologies but I can help you this much only.

 

Pankaj

Marked as Best Answer.
Solution
Accepted by rashu (Google Employee)
September 2015

Re: Insert google adword tracking code while partial postback from ASP.NET

Google Employee
# 3
Google Employee

Hi FISIndiaPruhaw, 

 

Here are my thoughts on your two notes --

 

1) adding the HTML style comments section will not affect how the Google AdWords conversion tracking code executes, so this should not be preventing anything from happening with the conversion tracking code itself. 

 

2) the <noscript> section is for visitors who come to your website that do not have javascript enabled - this is typically a very small portion of your website traffic, if anything at all. As a reminder, this part of the conversion tracking code will only execute if someone has come to your website and they do not have javascript enabled. 

 

I would also recommend again the help center article that pankaj1782 mentioned. I hope this helps!

 

Sincerely,

Tiffany

Re: Insert google adword tracking code while partial postback from ASP.NET

[ Edited ]
Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

Hello Pankaj and Tiffany,

 

Appreciate your response on my query.

 

Well Tiffany, I thought the same way as you mentioned and in the result tried to execute the following portion through script manager, but still not getting any luck on this.

 

<script type="text/javascript">
        /* <![CDATA[ */
        var google_conversion_id = xxxxx;
        var google_conversion_language = "en";
        var google_conversion_format = "3";
        var google_conversion_color = "ffffff";
        var google_conversion_label = "xxxxxxx";
        var google_conversion_value = 0;
        /* ]]> */
    </script>
    <script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js">
    </script>

 

For the testing purpose, I placed an alert box inside this Script, and it was getting displayed as well, but the count on Adwords is still not getting updated.

 

Hope you could help me further on this.

 

Many Thanks,

Amit