Login  Register
Customized macros
Macros overridden by configurations
Search macros
View logs

use_google_analytics

NAML documentation   Watch a video
   Usages of this macro
The source code below doesn't have navigation links because no usage has been compiled yet. Navigation links depend on how and where the macro is used, so first you may try finding all usages of "use_google_analytics".
... in use_google_analytics.naml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<macro name="use_google_analytics" requires="servlet">
    <n.if.not.visitor.is_site_admin>
        <then>
            <n.login.><t>Only authorized users can proceed in this area.</t></n.login.>
        </then>
    </n.if.not.visitor.is_site_admin>
 
    <n.if.is_submitted_form>
        <then>
            <n.catch_exception. id="save-block">
                <n.if.is_valid_analytics_id.google_analytics_code_field.value>
                    <then>
                        <n.save_google_analytics_tweak/>
                        <n.redirect_to.root_node.url/>
                    </then>
                    <else.throw_template_exception name="invalid_analytics_id"/>
                </n.if.is_valid_analytics_id.google_analytics_code_field.value>
            </n.catch_exception.>
        </then>
        <else>
            <n.google_analytics_code_field.set_value value="[n.naml_configuration.get_value name='googleAnalyticsId' default=''/]"/>
        </else>
    </n.if.is_submitted_form>
 
    <n.html>
        <head>
            <meta name="robots" content="noindex,nofollow"/>
            <n.title.><t>Use Google Analytics</t></n.title.>
            <n.google_analytics_code_field.focus/>
        </head>
        <body>
            <n.edit_header first_text="[n.root_node.subject/]" second_text="[t]Use Google Analytics[/t]" />
 
            <n.if.both condition1="[n.is_submitted_form/]" condition2="[n.has_exception for='save-block'/]">
                <then>
                    <n.format_error.handle_exception. for="save-block">
                        <n.exception. name="invalid_analytics_id">
                            <t>Enter a valid analytics account ID.</t>
                        </n.exception.>
                    </n.format_error.handle_exception.>
                </then>
            </n.if.both>
 
            <div style="margin:1.5em 0">
                <t>Here you can use Google Analytics to measure the success of your app.</t>
                <t>Enter below your analytics account ID and you will be able to track visits, visitors and other important statistics about your web traffic.</t>
            </div>
 
            <n.form.>
                <t>Analytics Account ID:</t>
                <n.google_analytics_code_field.input type="text" size="20" maxlength="20"/>
                <t>(e.g., UA-12345-0)</t>
                <div style="margin-top:1.5em">
                    <input type="submit" class="toolbar action-button" value="[t]Save Changes[/t]" />
                    <t>or</t> <a href="[n.root_node.url/]"><t>Cancel</t></a>
                </div>
            </n.form.>
        </body>
    </n.html>
</macro>